fix: 修复不同页签之间认证共享问题 (#558)

This commit is contained in:
shaohuzhang1 2024-05-27 18:05:30 +08:00 committed by GitHub
parent 45c65f4cc4
commit a03a2e88fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ const useApplicationStore = defineStore({
applicationApi applicationApi
.postAppAuthentication(token, loading) .postAppAuthentication(token, loading)
.then((res) => { .then((res) => {
localStorage.setItem('accessToken', res.data) sessionStorage.setItem('accessToken', res.data)
resolve(res) resolve(res)
}) })
.catch((error) => { .catch((error) => {

View File

@ -24,7 +24,7 @@ const useUserStore = defineStore({
} }
return this.userType === 1 return this.userType === 1
? localStorage.getItem('token') ? localStorage.getItem('token')
: localStorage.getItem('accessToken') : sessionStorage.getItem('accessToken')
}, },
getPermissions() { getPermissions() {