diff --git a/src/constants/business.ts b/src/constants/business.ts index e873957..877722e 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -40,6 +40,11 @@ export const menuIconTypeRecord: Record = { + '1': 'R_ADMIN', + '2': 'R_SUPER' +}; + export const podsType: Record = { 1: 'page.pods.type.client', 2: 'page.pods.type.server' diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 0d9167e..42735d2 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -7,6 +7,7 @@ import { useRouterPush } from '@/hooks/common/router'; import { fetchGetUserInfo, fetchLogin } from '@/service/api'; import { localStg } from '@/utils/storage'; import { $t } from '@/locales'; +import { roleTypeRecord } from '@/constants/business'; import { useRouteStore } from '../route'; import { clearAuthStorage, getToken, getUserInfo } from './shared'; @@ -93,7 +94,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { if (!error) { info!.userName = info?.username; - info!.roles = [info.role]; + info!.roles = [roleTypeRecord[info.role]]; // 2. store user info localStg.set('userInfo', info);