diff --git a/packages/ui/certd-client/src/api/modules/api.user.ts b/packages/ui/certd-client/src/api/modules/api.user.ts index bb7a1973..735c3bf5 100644 --- a/packages/ui/certd-client/src/api/modules/api.user.ts +++ b/packages/ui/certd-client/src/api/modules/api.user.ts @@ -18,7 +18,7 @@ export interface UserInfoRes { id: string | number; username: string; nickName: string; - roles: number[]; + roleIds: number[]; } export interface LoginRes { diff --git a/packages/ui/certd-client/src/store/modules/user.ts b/packages/ui/certd-client/src/store/modules/user.ts index bdf177f0..7ce198aa 100644 --- a/packages/ui/certd-client/src/store/modules/user.ts +++ b/packages/ui/certd-client/src/store/modules/user.ts @@ -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: {