个人中心信息更新、重置cc密码

This commit is contained in:
陈淳
2022-09-14 20:35:45 +08:00
parent ea2be7609c
commit e535133eca
11 changed files with 106 additions and 29 deletions

View File

@@ -37,15 +37,18 @@ const useUserStore = defineStore(
const res=response.data;
const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : import.meta.env.VITE_APP_BASE_API + user.avatar;
if (res.roleCodes && res.roleCodes.length > 0) { // 验证返回的roles是否是一个非空数组
// this.roles = res.roleCodes
// this.permissions = res.permissionCodes
this.roles = ["admin"];
this.permissions=["*:*:*"]
} else {
this.roles = ['ROLE_DEFAULT']
}
this.roles = ["admin"];
this.permissions=["*:*:*"]
this.name = user.userName
this.avatar = avatar;
resolve(res)