mirror of
https://github.com/certd/certd.git
synced 2026-04-03 14:10:54 +08:00
chore:
This commit is contained in:
@@ -18,7 +18,7 @@ export interface UserInfoRes {
|
||||
id: string | number;
|
||||
username: string;
|
||||
nickName: string;
|
||||
roles: number[];
|
||||
roleIds: number[];
|
||||
}
|
||||
|
||||
export interface LoginRes {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user