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 }