refactor(login.vue): 验证码样式优化
Former-commit-id: f00e65d275b07c7bddf38f714bafae796090c889
This commit is contained in:
@@ -133,11 +133,13 @@ const state = reactive({
|
|||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: '123456',
|
password: '123456',
|
||||||
code: '',
|
code: '',
|
||||||
uuid: ''
|
uuid: '',
|
||||||
} as LoginFormData,
|
} as LoginFormData,
|
||||||
loginRules: {
|
loginRules: {
|
||||||
username: [{ required: true, trigger: 'blur' }],
|
username: [{ required: true, trigger: 'blur' }],
|
||||||
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
password: [
|
||||||
|
{ required: true, trigger: 'blur', validator: validatePassword },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
passwordType: 'password',
|
passwordType: 'password',
|
||||||
@@ -146,7 +148,7 @@ const state = reactive({
|
|||||||
capslockTooltipDisabled: true,
|
capslockTooltipDisabled: true,
|
||||||
otherQuery: {},
|
otherQuery: {},
|
||||||
clientHeight: document.documentElement.clientHeight,
|
clientHeight: document.documentElement.clientHeight,
|
||||||
showCopyright: true
|
showCopyright: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
function validatePassword(rule: any, value: any, callback: any) {
|
function validatePassword(rule: any, value: any, callback: any) {
|
||||||
@@ -164,7 +166,7 @@ const {
|
|||||||
passwordType,
|
passwordType,
|
||||||
captchaBase64,
|
captchaBase64,
|
||||||
capslockTooltipDisabled,
|
capslockTooltipDisabled,
|
||||||
showCopyright
|
showCopyright,
|
||||||
} = toRefs(state);
|
} = toRefs(state);
|
||||||
|
|
||||||
function checkCapslock(e: any) {
|
function checkCapslock(e: any) {
|
||||||
@@ -208,7 +210,7 @@ function handleLogin() {
|
|||||||
function handleCaptchaGenerate() {
|
function handleCaptchaGenerate() {
|
||||||
getCaptcha().then(({ data }) => {
|
getCaptcha().then(({ data }) => {
|
||||||
const { img, uuid } = data;
|
const { img, uuid } = data;
|
||||||
state.captchaBase64 = 'data:image/gif;base64,' + img;
|
state.captchaBase64 = img;
|
||||||
state.loginForm.uuid = uuid;
|
state.loginForm.uuid = uuid;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -223,7 +225,7 @@ watch(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -281,7 +283,7 @@ $cursor: #fff;
|
|||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 47px;
|
height: 36px;
|
||||||
width: 85%;
|
width: 85%;
|
||||||
.el-input__wrapper {
|
.el-input__wrapper {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -292,9 +294,8 @@ $cursor: #fff;
|
|||||||
border: 0px;
|
border: 0px;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
padding: 12px 5px 12px 15px;
|
|
||||||
color: $light_gray;
|
color: $light_gray;
|
||||||
height: 47px;
|
height: 36px;
|
||||||
caret-color: $cursor;
|
caret-color: $cursor;
|
||||||
|
|
||||||
&:-webkit-autofill {
|
&:-webkit-autofill {
|
||||||
@@ -365,7 +366,7 @@ $light_gray: #eee;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.svg-container {
|
.svg-container {
|
||||||
padding: 6px 5px 6px 15px;
|
padding: 5px 10px;
|
||||||
color: $dark_gray;
|
color: $dark_gray;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
@@ -400,7 +401,7 @@ $light_gray: #eee;
|
|||||||
top: 0;
|
top: 0;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 52px;
|
height: 42px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user