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