对接后端

This commit is contained in:
ovo 2024-12-07 16:39:00 +08:00
parent b6718315db
commit 0fab567259
2 changed files with 5 additions and 3 deletions

View File

@ -51,6 +51,7 @@ const userStore = useUserStore()
onMounted(async () => { onMounted(async () => {
const token = localStorage.getItem('token') const token = localStorage.getItem('token')
if (token && !userStore.userInfo) { if (token && !userStore.userInfo) {
userStore.setToken(token)
await userStore.getUserInfo() await userStore.getUserInfo()
} }
}) })

View File

@ -294,14 +294,15 @@ const handleLogin = async () => {
switch (activeTab.value) { switch (activeTab.value) {
case 'account': case 'account':
formRef = accountFormRef.value formRef = accountFormRef.value
formData = { ...accountForm, activeTab: activeTab.value }; formData = { ...accountForm, activeTab: activeTab.value }
break break
case 'phone': case 'phone':
formRef = phoneFormRef.value formRef = phoneFormRef.value
formData = { ...phoneForm, activeTab: activeTab.value }; formData = { ...phoneForm, activeTab: activeTab.value }
break
case 'email': case 'email':
formRef = emailFormRef.value formRef = emailFormRef.value
formData = { ...emailForm, activeTab: activeTab.value }; formData = { ...emailForm, activeTab: activeTab.value }
break break
} }