update 优化 全局数据存储用户编号

This commit is contained in:
疯狂的狮子Li
2023-10-09 10:20:12 +08:00
parent 79fd63599a
commit a6ef8bb938
2 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ const useUserStore = defineStore(
{
state: () => ({
token: getToken(),
id: '',
name: '',
avatar: '',
roles: [],
@ -42,8 +43,9 @@ const useUserStore = defineStore(
} else {
this.roles = ['ROLE_DEFAULT']
}
this.id = user.userId
this.name = user.userName
this.avatar = avatar;
this.avatar = avatar
resolve(res)
}).catch(error => {
reject(error)