refactor: 修改角色权限标识
This commit is contained in:
parent
52de73f6fc
commit
1541c39dbd
@ -40,6 +40,11 @@ export const menuIconTypeRecord: Record<Api.SystemManage.IconType, App.I18n.I18n
|
|||||||
|
|
||||||
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);
|
export const menuIconTypeOptions = transformRecordToOption(menuIconTypeRecord);
|
||||||
|
|
||||||
|
export const roleTypeRecord: Record<string, string> = {
|
||||||
|
'1': 'R_ADMIN',
|
||||||
|
'2': 'R_SUPER'
|
||||||
|
};
|
||||||
|
|
||||||
export const podsType: Record<Api.Dashboard.DashboardPodsType, App.I18n.I18nKey> = {
|
export const podsType: Record<Api.Dashboard.DashboardPodsType, App.I18n.I18nKey> = {
|
||||||
1: 'page.pods.type.client',
|
1: 'page.pods.type.client',
|
||||||
2: 'page.pods.type.server'
|
2: 'page.pods.type.server'
|
||||||
|
@ -7,6 +7,7 @@ import { useRouterPush } from '@/hooks/common/router';
|
|||||||
import { fetchGetUserInfo, fetchLogin } from '@/service/api';
|
import { fetchGetUserInfo, fetchLogin } from '@/service/api';
|
||||||
import { localStg } from '@/utils/storage';
|
import { localStg } from '@/utils/storage';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
import { roleTypeRecord } from '@/constants/business';
|
||||||
import { useRouteStore } from '../route';
|
import { useRouteStore } from '../route';
|
||||||
import { clearAuthStorage, getToken, getUserInfo } from './shared';
|
import { clearAuthStorage, getToken, getUserInfo } from './shared';
|
||||||
|
|
||||||
@ -93,7 +94,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
info!.userName = info?.username;
|
info!.userName = info?.username;
|
||||||
info!.roles = [info.role];
|
info!.roles = [roleTypeRecord[info.role]];
|
||||||
// 2. store user info
|
// 2. store user info
|
||||||
localStg.set('userInfo', info);
|
localStg.set('userInfo', info);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user