This commit is contained in:
Taric Xin
2022-02-15 14:19:33 +08:00
parent 4b99e7ba59
commit d2ba3f393f
3 changed files with 14 additions and 11 deletions

View File

@ -32,9 +32,9 @@ export class AuthGuard extends ACLGuard {
constructor(
srv: ACLService,
public srv1: ACLService,
private baseService: BaseService,
private menuService: MenuService,
private settings: SettingsService,
private userService: EAUserService,
router: Router,
private inject: Injector
) {
@ -62,7 +62,7 @@ export class AuthGuard extends ACLGuard {
if (!router) {
return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state);
}
return this.baseService
return this.userService
.request('/api/mdc/cuc/userAuthority/isUserAdmin', {
appUserId: this.settings.user.appUserId
})
@ -74,13 +74,14 @@ export class AuthGuard extends ACLGuard {
return of(true);
} else {
// 如果不是超级管理员 获取权限
return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router });
return this.userService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router });
}
}),
switchMap(res => {
if (res?.abilities) {
this.srv1.setAbility(res.abilities || []);
this.menuService.resume();
// this.menuService.resume();
this.userService.loadUserMenus();
}
return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state);
})