pull/213/head
xiaojunnuo 2024-10-15 12:01:38 +08:00
parent 02fe704769
commit 41ad0aea2b
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export interface UserInfoRes {
id: string | number;
username: string;
nickName: string;
roles: number[];
roleIds: number[];
}
export interface LoginRes {

View File

@ -37,7 +37,7 @@ export const useUserStore = defineStore({
return this.token || LocalStorage.get(TOKEN_KEY);
},
isAdmin(): boolean {
return this.getUserInfo.id === 1 || this.getUserInfo.roles?.includes(1);
return this.getUserInfo.roleIds?.includes(1) || this.getUserInfo.id === 1;
}
},
actions: {