mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 09:03:54 +08:00
fix: 修复web、h5同时打开token失效问题
This commit is contained in:
@@ -51,10 +51,11 @@ export const useUserStore = defineStore(
|
||||
*/
|
||||
const getUserInfo = async () => {
|
||||
const userData = await _getUserInfo()
|
||||
const authInfo = JSON.parse(uni.getStorageSync('token') || '{}')
|
||||
const userInfoWithExtras = {
|
||||
...userData,
|
||||
avatar: userInfoState.avatar,
|
||||
token: uni.getStorageSync('token') || '',
|
||||
token: authInfo.token || '',
|
||||
}
|
||||
setUserInfo(userInfoWithExtras)
|
||||
uni.setStorageSync('userInfo', userInfoWithExtras)
|
||||
|
||||
Reference in New Issue
Block a user