From 0fab5672592b17ae35b0404c01022502b348e48d Mon Sep 17 00:00:00 2001 From: ovo Date: Sat, 7 Dec 2024 16:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Topbar.vue | 1 + src/views/LoginView.vue | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Topbar.vue b/src/components/Topbar.vue index fc72e23..7fd6289 100644 --- a/src/components/Topbar.vue +++ b/src/components/Topbar.vue @@ -51,6 +51,7 @@ const userStore = useUserStore() onMounted(async () => { const token = localStorage.getItem('token') if (token && !userStore.userInfo) { + userStore.setToken(token) await userStore.getUserInfo() } }) diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index d1579d0..f51bef2 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -294,14 +294,15 @@ const handleLogin = async () => { switch (activeTab.value) { case 'account': formRef = accountFormRef.value - formData = { ...accountForm, activeTab: activeTab.value }; + formData = { ...accountForm, activeTab: activeTab.value } break case 'phone': formRef = phoneFormRef.value - formData = { ...phoneForm, activeTab: activeTab.value }; + formData = { ...phoneForm, activeTab: activeTab.value } + break case 'email': formRef = emailFormRef.value - formData = { ...emailForm, activeTab: activeTab.value }; + formData = { ...emailForm, activeTab: activeTab.value } break }