This commit is contained in:
qinjie 2021-08-20 16:29:28 +08:00
parent 1fd2c069c9
commit 5039bc0deb
3 changed files with 133 additions and 56 deletions

108
public/index.html vendored
View File

@ -1,28 +1,127 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title>Ant Design Pro</title>
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
<style>
.first-loading-wrp {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-height: 420px;
height: 100%
}
.first-loading-wrp>h1 {
font-size: 128px
}
.first-loading-wrp .loading-wrp {
padding: 98px;
display: flex;
justify-content: center;
align-items: center
}
.dot {
animation: antRotate 1.2s infinite linear;
transform: rotate(45deg);
position: relative;
display: inline-block;
font-size: 32px;
width: 32px;
height: 32px;
box-sizing: border-box
}
.dot i {
width: 14px;
height: 14px;
position: absolute;
display: block;
background-color: #1890ff;
border-radius: 100%;
transform: scale(.75);
transform-origin: 50% 50%;
opacity: .3;
animation: antSpinMove 1s infinite linear alternate
}
.dot i:nth-child(1) {
top: 0;
left: 0
}
.dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: .4s;
animation-delay: .4s
}
.dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: .8s;
animation-delay: .8s
}
.dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg)
}
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg)
}
}
@keyframes antSpinMove {
to {
opacity: 1
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1
}
}
</style>
<!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %>
</head>
<body>
<noscript>
<strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app">
<div class="first-loading-wrp">
<h1>Pro</h1>
<!-- <h1>Pro</h1> -->
<div class="loading-wrp">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
<div style="display: flex; justify-content: center; align-items: center;">Ant Design</div>
<!-- <div style="display: flex; justify-content: center; align-items: center;">Ant Design</div> -->
</div>
</div>
<!-- require cdn assets js -->
@ -31,4 +130,5 @@
<% } %>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,57 +1,31 @@
<template>
<div class="main">
<a-form
id="formLogin"
class="user-layout-login"
ref="formLogin"
:form="form"
@submit="handleSubmit"
>
<a-form id="formLogin" class="user-layout-login" ref="formLogin" :form="form" @submit="handleSubmit">
<a-alert v-if="isLoginError" type="error" showIcon style="margin-bottom: 24px;" message="账户或密码错误18729260811/a123456789 )" />
<a-form-item>
<a-input
size="large"
type="text"
placeholder="账户: 18729260811"
v-decorator="[
<a-input size="large" type="text" placeholder="账户: 18729260811" v-decorator="[
'mobile',
{rules: [{ required: true, message: '请输入帐户名或邮箱地址' }], validateTrigger: 'change'}
]"
>
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
]">
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input>
</a-form-item>
<a-form-item>
<a-input-password
size="large"
placeholder="密码: a123456789"
v-decorator="[
<a-input-password size="large" placeholder="密码: a123456789" v-decorator="[
'password',
{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}
]"
>
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
]">
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input-password>
</a-form-item>
<a-form-item>
<a-checkbox v-decorator="['rememberMe', { valuePropName: 'checked' }]">自动登录</a-checkbox>
<router-link
:to="{ name: 'recover', params: { user: 'aaa'} }"
class="forge-password"
style="float: right;"
>忘记密码</router-link>
<router-link :to="{ name: 'recover', params: { user: 'aaa'} }" class="forge-password" style="float: right;">忘记密码</router-link>
</a-form-item>
<a-form-item style="margin-top:24px">
<a-button
size="large"
type="primary"
htmlType="submit"
class="login-button"
:loading="state.loginBtn"
:disabled="state.loginBtn"
>确定</a-button>
<a-button size="large" type="primary" htmlType="submit" class="login-button" :loading="state.loginBtn" :disabled="state.loginBtn">确定</a-button>
</a-form-item>
</a-form>
</div>
@ -62,7 +36,7 @@ import { mapActions } from 'vuex'
import { timeFix } from '@/utils/util'
export default {
data () {
data() {
return {
loginBtn: false,
loginType: 0,
@ -77,7 +51,7 @@ export default {
},
methods: {
...mapActions(['Login', 'Logout']),
handleSubmit (e) {
handleSubmit(e) {
e.preventDefault()
const {
form: { validateFields },
@ -108,7 +82,7 @@ export default {
}
})
},
loginSuccess (res) {
loginSuccess(res) {
this.$router.push({ path: '/' })
// 1
setTimeout(() => {
@ -119,7 +93,7 @@ export default {
}, 1000)
this.isLoginError = false
},
requestFailed () {
requestFailed() {
this.isLoginError = true
}
}

View File

@ -5,7 +5,7 @@ const GitRevision = new GitRevisionPlugin()
const buildDate = JSON.stringify(new Date().toLocaleString())
const createThemeColorReplacerPlugin = require('./config/plugin.config')
function resolve (dir) {
function resolve(dir) {
return path.join(__dirname, dir)
}
@ -93,14 +93,17 @@ const vueConfig = {
},
devServer: {
disableHostCheck: true, // 解决vue项目中的“Invalid Host header”问题
port: 8001, // development server port 默认8001这个得看你的项目申请的端口号是多少而定
// 如果需要开启代理,请移除mockjs /src/main.jsL11
disableHostCheck: true, // <EFBFBD><EFBFBD><EFBFBD>vue<EFBFBD><EFBFBD>Ŀ<EFBFBD>еġ<EFBFBD>Invalid Host header<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
port: 8001, // development server port Ĭ<EFBFBD><EFBFBD>8001<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ˿ں<EFBFBD><EFBFBD>Ƕ<EFBFBD><EFBFBD>ٶ<EFBFBD><EFBFBD><EFBFBD>
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>mockjs /src/main.jsL11
proxy: {
'/dawa': { // 捕获API的标志如果API中有这个字符串那么就开始匹配代理
target: 'http://a.3a6.cn/', // 地址可以是域名也可以是IP地址。比如API请求/api/getList, 会被代理到请求http://www.baidu.com/api/getList 。
'/dawa': { // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>API<EFBFBD>ı<EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>API<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>Ϳ<EFBFBD>ʼƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
target: 'http://a.3a6.cn/', // <EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>API<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/api/getList, <20><EFBFBD><E1B1BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>http://www.baidu.com/api/getList <20><>
ws: false,
changeOrigin: true // 如果target是域名需要额外添加一个参数changeOrigin: true否则会代理失败。
changeOrigin: true // <20><><EFBFBD>target<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>changeOrigin: true<75><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܡ<EFBFBD>
// ,pathRewrite: {
// '^/dawa': '/'
// }
}
}
},