権限変更修正

This commit is contained in:
xiaozhe.ma
2024-11-24 19:00:17 +09:00
parent 4cd3aff868
commit 0fddeaa036
2 changed files with 6 additions and 4 deletions

View File

@@ -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') }

View File

@@ -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();