refactor: 系统管理页面重构和ts类型声明优化
Former-commit-id: 40263bbb072596ada41ef33d9170841e7e66cd01
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
<!-- 验证码 -->
|
||||
<el-form-item prop="code">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="validCode" />
|
||||
<svg-icon icon-class="valid_code" />
|
||||
</span>
|
||||
<el-input
|
||||
v-model="loginForm.code"
|
||||
@@ -119,7 +119,7 @@ import useStore from '@/store';
|
||||
// API依赖
|
||||
import { getCaptcha } from '@/api/login';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { LoginFormData } from '@/types';
|
||||
import { LoginFormData } from '@/types/api/system/login';
|
||||
|
||||
const { user } = useStore();
|
||||
const route = useRoute();
|
||||
@@ -133,11 +133,13 @@ const state = reactive({
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
code: '',
|
||||
uuid: ''
|
||||
uuid: '',
|
||||
} as LoginFormData,
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur' }],
|
||||
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
||||
password: [
|
||||
{ required: true, trigger: 'blur', validator: validatePassword },
|
||||
],
|
||||
},
|
||||
loading: false,
|
||||
passwordType: 'password',
|
||||
@@ -146,7 +148,7 @@ const state = reactive({
|
||||
capslockTooltipDisabled: true,
|
||||
otherQuery: {},
|
||||
clientHeight: document.documentElement.clientHeight,
|
||||
showCopyright: true
|
||||
showCopyright: true,
|
||||
});
|
||||
|
||||
function validatePassword(rule: any, value: any, callback: any) {
|
||||
@@ -164,7 +166,7 @@ const {
|
||||
passwordType,
|
||||
captchaBase64,
|
||||
capslockTooltipDisabled,
|
||||
showCopyright
|
||||
showCopyright,
|
||||
} = toRefs(state);
|
||||
|
||||
function checkCapslock(e: any) {
|
||||
@@ -223,7 +225,7 @@ watch(
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user