mirror of https://github.com/certd/certd
chore:
parent
02fe704769
commit
41ad0aea2b
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue