|
@@ -124,22 +124,22 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- activeTop: "-50%", // 色条滑块控制
|
|
|
- rememberPsw: false, // 记住密码选择框
|
|
|
+ activeTop: "-50%",
|
|
|
+ rememberPsw: false,
|
|
|
loginForm: {
|
|
|
loginName: "",
|
|
|
password: "",
|
|
|
verifyCode: ""
|
|
|
- }, // 登录表单
|
|
|
+ },
|
|
|
loginRules: {
|
|
|
loginName: [{ required: true, message: "用户名必填", trigger: "blur" }],
|
|
|
password: [{ required: true, message: "用户密码必填", trigger: "blur" }]
|
|
|
- }, // 登录表单验证
|
|
|
- passwordType: "password", // 用来控制查看密码操作时的输入框类型
|
|
|
- capsTooltip: false, // 键盘大写是否打开
|
|
|
- loading: false, // 登录loding
|
|
|
- redirect: undefined, // 记录重定向地址
|
|
|
- otherQuery: {}, // 记录重定向地址中的参数
|
|
|
+ },
|
|
|
+ passwordType: "password",
|
|
|
+ capsTooltip: false,
|
|
|
+ loading: false,
|
|
|
+ redirect: undefined,
|
|
|
+ otherQuery: {},
|
|
|
needCaptcha: false
|
|
|
};
|
|
|
},
|
|
@@ -157,14 +157,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- // 获取焦点
|
|
|
- if (this.loginForm.loginName === "") {
|
|
|
- this.$refs.loginName.focus();
|
|
|
- } else if (this.loginForm.password === "") {
|
|
|
- this.$refs.password.focus();
|
|
|
- }
|
|
|
+ this.handleLoginFocus();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleLoginFocus() {
|
|
|
+ if (this.loginForm.loginName === "") {
|
|
|
+ this.$refs.loginName.focus();
|
|
|
+ } else if (this.loginForm.password === "") {
|
|
|
+ this.$refs.password.focus();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取存储的密码并解密
|
|
|
getPsw() {
|
|
|
const cookVal = cookies.get(`u_${this.loginForm.loginName}`);
|
|
@@ -269,7 +271,6 @@ export default {
|
|
|
background: #fff;
|
|
|
}
|
|
|
|
|
|
-/* reset element-ui css */
|
|
|
.login_container {
|
|
|
.el-input {
|
|
|
display: inline-block;
|
|
@@ -321,7 +322,6 @@ export default {
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
height: calc(100% - 60px);
|
|
|
- // height: 100%;
|
|
|
.login_img {
|
|
|
display: block;
|
|
|
width: 100%;
|
|
@@ -420,7 +420,6 @@ export default {
|
|
|
p {
|
|
|
padding-left: 8px;
|
|
|
}
|
|
|
- // justify-content: space-between;
|
|
|
& > input {
|
|
|
position: relative;
|
|
|
width: 14px;
|