mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
chore:
This commit is contained in:
@@ -18,7 +18,7 @@ export interface UserInfoRes {
|
|||||||
id: string | number;
|
id: string | number;
|
||||||
username: string;
|
username: string;
|
||||||
nickName: string;
|
nickName: string;
|
||||||
roles: number[];
|
roleIds: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LoginRes {
|
export interface LoginRes {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const useUserStore = defineStore({
|
|||||||
return this.token || LocalStorage.get(TOKEN_KEY);
|
return this.token || LocalStorage.get(TOKEN_KEY);
|
||||||
},
|
},
|
||||||
isAdmin(): boolean {
|
isAdmin(): boolean {
|
||||||
return this.getUserInfo.id === 1 || this.getUserInfo.roles?.includes(1);
|
return this.getUserInfo.roleIds?.includes(1) || this.getUserInfo.id === 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user