diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 065a5ee18368278a27f2c30c9237202de980381f..8340d94684c84b8485c51540acc50193e0c00fa0 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -162,7 +162,7 @@ export const useUserStore = defineStore({ const role = userInfo.userRoles[0].roleNum; //取第一个为默认角色 const roleList = Array.from(RoleEnum[role]); - this.setRoleList(roleList as []); + this.setRoleList(this.getRoleList || (roleList as [])); } else { userInfo.userRoles = []; this.setRoleList([]);