diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index 95e5cbd..1b999ad 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -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') } diff --git a/frontend/src/stores/useAuthStore.ts b/frontend/src/stores/useAuthStore.ts index f2a0895..985d893 100644 --- a/frontend/src/stores/useAuthStore.ts +++ b/frontend/src/stores/useAuthStore.ts @@ -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();