権限変更修正
This commit is contained in:
@@ -25,7 +25,7 @@ const routes: RouteRecordRaw[] = [
|
||||
// { path: 'FlowChart', component: () => import('pages/FlowChart.vue') },
|
||||
{ path: 'right', component: () => import('pages/testRight.vue') },
|
||||
{ path: 'domain', component: () => import('pages/TenantDomain.vue') },
|
||||
// { path: 'userdomain', component: () => import('pages/UserDomain.vue')},
|
||||
{ path: 'userdomain', component: () => import('pages/UserDomain.vue')},
|
||||
{ path: 'user', component: () => import('pages/UserManagement.vue')},
|
||||
{ path: 'app', component: () => import('pages/AppManagement.vue')},
|
||||
{ path: 'condition', component: () => import('pages/conditionPage.vue') }
|
||||
|
||||
@@ -16,7 +16,8 @@ export interface IUserState {
|
||||
LeftDrawer: boolean;
|
||||
userId?: string;
|
||||
userInfo: UserInfo;
|
||||
permissions: 'admin' | 'user';
|
||||
roles:string,
|
||||
permissions: string;
|
||||
}
|
||||
|
||||
export const useAuthStore = defineStore('auth', {
|
||||
@@ -27,7 +28,8 @@ export const useAuthStore = defineStore('auth', {
|
||||
currentDomain: {} as IDomainInfo,
|
||||
userId: '',
|
||||
userInfo: {} as UserInfo,
|
||||
permissions: 'user',
|
||||
roles:'',
|
||||
permissions: '',
|
||||
}),
|
||||
getters: {
|
||||
toggleLeftDrawer(): boolean {
|
||||
@@ -51,7 +53,7 @@ export const useAuthStore = defineStore('auth', {
|
||||
this.token = result.data.access_token;
|
||||
const tokenJson = jwtDecode(result.data.access_token);
|
||||
this.userId = tokenJson.sub;
|
||||
this.permissions = (tokenJson as any).permissions ?? 'user';
|
||||
this.permissions = (tokenJson as any).permissions==='ALL' ? 'admin': 'user';
|
||||
api.defaults.headers['Authorization'] = 'Bearer ' + this.token;
|
||||
this.currentDomain = await this.getCurrentDomain();
|
||||
this.userInfo = await this.getUserInfo();
|
||||
|
||||
Reference in New Issue
Block a user