From cf34013c5328772fbbf8d5f65368896c256e3895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=8C=E7=B3=96=E5=8C=85=E5=AD=90?= Date: Thu, 19 Mar 2026 23:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=A1=B5/=E6=AC=A2=E8=BF=8E?= =?UTF-8?q?=E9=A1=B5=E7=BE=8E=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + src/views/Login.vue | 199 +++++++++++++++++++++++++++++++++++++----- src/views/Welcome.vue | 128 ++++++++++++++++++++++----- 3 files changed, 281 insertions(+), 47 deletions(-) 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