|
|
@ -6,7 +6,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-form
|
|
|
|
<el-form
|
|
|
|
class="card-box login-form"
|
|
|
|
class="card-box login-form"
|
|
|
|
autocomplete="on"
|
|
|
|
autocomplete="on+
|
|
|
|
:model="ruleForm"
|
|
|
|
:model="ruleForm"
|
|
|
|
:rules="rules"
|
|
|
|
:rules="rules"
|
|
|
|
ref="ruleForm"
|
|
|
|
ref="ruleForm"
|
|
|
@ -14,7 +14,7 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-card class="box-card">
|
|
|
|
<el-card class="box-card">
|
|
|
|
<div style="text-align: center; margin-top: 10px">
|
|
|
|
<div style="text-align: center; margin-top: 10px">
|
|
|
|
<img alt="element-logo" src="@/assets/logo/logo.png" />
|
|
|
|
<img alt="element-logo" src="@/assets/logo/logo.png"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<h3 class="title">用户登录</h3>
|
|
|
|
<h3 class="title">用户登录</h3>
|
|
|
|
<el-form-item prop="username" class="item" style="margin-top: -20px">
|
|
|
|
<el-form-item prop="username" class="item" style="margin-top: -20px">
|
|
|
@ -25,7 +25,7 @@
|
|
|
|
v-model="loginForm.username"
|
|
|
|
v-model="loginForm.username"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i slot="prefix" class="el-input__icon">
|
|
|
|
<i slot="prefix" class="el-input__icon">
|
|
|
|
<icon-svg icon-class="user" />
|
|
|
|
<icon-svg icon-class="user"/>
|
|
|
|
</i>
|
|
|
|
</i>
|
|
|
|
</el-input>
|
|
|
|
</el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -39,14 +39,14 @@
|
|
|
|
autocomplete="on"
|
|
|
|
autocomplete="on"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i slot="prefix" class="el-input__icon">
|
|
|
|
<i slot="prefix" class="el-input__icon">
|
|
|
|
<icon-svg icon-class="pwd" />
|
|
|
|
<icon-svg icon-class="pwd"/>
|
|
|
|
</i>
|
|
|
|
</i>
|
|
|
|
<i
|
|
|
|
<i
|
|
|
|
slot="suffix"
|
|
|
|
slot="suffix"
|
|
|
|
class="el-input__icon"
|
|
|
|
class="el-input__icon"
|
|
|
|
@click="isShowPwd = !isShowPwd"
|
|
|
|
@click="isShowPwd = !isShowPwd"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<icon-svg icon-class="eye" />
|
|
|
|
<icon-svg icon-class="eye"/>
|
|
|
|
</i>
|
|
|
|
</i>
|
|
|
|
</el-input>
|
|
|
|
</el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
@ -71,7 +71,7 @@
|
|
|
|
style="width: 60%; margin-bottom: 30px"
|
|
|
|
style="width: 60%; margin-bottom: 30px"
|
|
|
|
:loading="loading"
|
|
|
|
:loading="loading"
|
|
|
|
@click.native="handleLogin()"
|
|
|
|
@click.native="handleLogin()"
|
|
|
|
>登录
|
|
|
|
>登录
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
</el-card>
|
|
|
@ -96,7 +96,7 @@
|
|
|
|
import Verify from "vue2-verify";
|
|
|
|
import Verify from "vue2-verify";
|
|
|
|
import axios from "axios";
|
|
|
|
import axios from "axios";
|
|
|
|
import Cookies from "js-cookie";
|
|
|
|
import Cookies from "js-cookie";
|
|
|
|
import { decrypt, encrypt } from "@/utils/jsencrypt";
|
|
|
|
import {decrypt, encrypt} from "@/utils/jsencrypt";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
@ -124,9 +124,9 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
userName: [
|
|
|
|
userName: [
|
|
|
|
{ required: true, message: "请输入登录名", trigger: "blur" },
|
|
|
|
{required: true, message: "请输入登录名", trigger: "blur"},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
pwd: [{ validator: validatePwd, trigger: "blur" }],
|
|
|
|
pwd: [{validator: validatePwd, trigger: "blur"}],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isShowPwd: false, // 是否显示密码
|
|
|
|
isShowPwd: false, // 是否显示密码
|
|
|
|
loading: false, // 登录loading
|
|
|
|
loading: false, // 登录loading
|
|
|
@ -203,7 +203,7 @@ export default {
|
|
|
|
if (this.loginForm.verificationCode) {
|
|
|
|
if (this.loginForm.verificationCode) {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
if (this.loginForm.rememberMe) {
|
|
|
|
if (this.loginForm.rememberMe) {
|
|
|
|
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
|
|
|
Cookies.set("username", this.loginForm.username, {expires: 30});
|
|
|
|
Cookies.set("password", encrypt(this.loginForm.password), {
|
|
|
|
Cookies.set("password", encrypt(this.loginForm.password), {
|
|
|
|
expires: 30,
|
|
|
|
expires: 30,
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -217,8 +217,9 @@ export default {
|
|
|
|
.dispatch("Login", this.loginForm)
|
|
|
|
.dispatch("Login", this.loginForm)
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
this.$router
|
|
|
|
this.$router
|
|
|
|
.push({ path: this.redirect || "/" })
|
|
|
|
.push({path: this.redirect || "/"})
|
|
|
|
.catch((res) => {});
|
|
|
|
.catch((res) => {
|
|
|
|
|
|
|
|
});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((res) => {
|
|
|
|
.catch((res) => {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
@ -329,6 +330,7 @@ $light_gray: #eee;
|
|
|
|
font-weight: bold;
|
|
|
|
font-weight: bold;
|
|
|
|
margin-bottom: 50px;
|
|
|
|
margin-bottom: 50px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.textTitle {
|
|
|
|
.textTitle {
|
|
|
|
width: 50%;
|
|
|
|
width: 50%;
|
|
|
|
font-size: 45px;
|
|
|
|
font-size: 45px;
|
|
|
@ -340,6 +342,7 @@ $light_gray: #eee;
|
|
|
|
margin-top: 132px;
|
|
|
|
margin-top: 132px;
|
|
|
|
margin-bottom: -10px;
|
|
|
|
margin-bottom: -10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.topSubtitle {
|
|
|
|
.topSubtitle {
|
|
|
|
color: #fcd38b;
|
|
|
|
color: #fcd38b;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|