diff --git a/components.d.ts b/components.d.ts index c1c443d..c600702 100644 --- a/components.d.ts +++ b/components.d.ts @@ -22,6 +22,7 @@ declare module '@vue/runtime-core' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElHeader: typeof import('element-plus/es')['ElHeader'] + ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElMain: typeof import('element-plus/es')['ElMain'] ElMenu: typeof import('element-plus/es')['ElMenu'] diff --git a/src/views/Login.vue b/src/views/Login.vue index dfc26d9..349515e 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -1,16 +1,42 @@ @@ -44,6 +70,8 @@ const ruleValidate = { ], } +const loading = ref(false) + // created store.commit('logout') store.commit('clearTabs') @@ -52,7 +80,10 @@ localStorage.clear() async function login() { loginForm.value?.validate(async (valid: boolean) => { if (!valid) return - const data = await http.post('/api/v1/common/login', userInfo) + loading.value = true + const data = await http.post('/api/v1/common/login', userInfo).finally(() => { + loading.value = false + }) if (data.token) { store.commit('login', data) router.push('/') @@ -63,19 +94,139 @@ async function login() { } \ No newline at end of file diff --git a/src/views/Welcome.vue b/src/views/Welcome.vue index 5bac754..d39567d 100644 --- a/src/views/Welcome.vue +++ b/src/views/Welcome.vue @@ -1,14 +1,27 @@ @@ -16,22 +29,91 @@ import menus from '../config/menu' \ No newline at end of file