diff --git a/src/app/core/guards/auth.guard.ts b/src/app/core/guards/auth.guard.ts index 39753b5a..d1cdfaec 100644 --- a/src/app/core/guards/auth.guard.ts +++ b/src/app/core/guards/auth.guard.ts @@ -22,7 +22,7 @@ import { UrlTree } from '@angular/router'; import { ACLCanType, ACLGuard, ACLGuardType, ACLService } from '@delon/acl'; -import { MenuService } from '@delon/theme'; +import { MenuService, SettingsService } from '@delon/theme'; import { BaseService, EAUserService } from '@shared'; import { Observable, of } from 'rxjs'; import { delay, map, switchMap, tap } from 'rxjs/operators'; @@ -34,6 +34,7 @@ export class AuthGuard extends ACLGuard { public srv1: ACLService, private baseService: BaseService, private menuService: MenuService, + private settings: SettingsService, router: Router, private inject: Injector ) { @@ -61,25 +62,29 @@ export class AuthGuard extends ACLGuard { if (!router) { return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state); } - return this.baseService.request('/api/mdc/cuc/enterpriseProject/getUserDefaultEnterpriseProject').pipe( - switchMap(res => { - if (res.enterpriseIdentity) { - // 超级管理员赋值全量权限 - this.srv1.setFull(true); - return of(true); - } else { - // 如果不是超级管理员 获取权限 - return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }); - } - }), - switchMap(res => { - if (res?.abilities) { - this.srv1.setAbility(res.abilities || []); - this.menuService.resume(); - } - return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state); + return this.baseService + .request('/api/mdc/cuc/userAuthority/isUserAdmin', { + appUserId: this.settings.user.appUserId }) - ); + .pipe( + switchMap(res => { + if (res) { + // 超级管理员赋值全量权限 + this.srv1.setFull(true); + return of(true); + } else { + // 如果不是超级管理员 获取权限 + return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }); + } + }), + switchMap(res => { + if (res?.abilities) { + this.srv1.setAbility(res.abilities || []); + this.menuService.resume(); + } + return type === 1 ? super.canActivate(route, state) : super.canActivateChild(route, state); + }) + ); } /** diff --git a/src/app/routes/usercenter/components/driver/driver.component.ts b/src/app/routes/usercenter/components/driver/driver.component.ts index 46357648..8e12466f 100644 --- a/src/app/routes/usercenter/components/driver/driver.component.ts +++ b/src/app/routes/usercenter/components/driver/driver.component.ts @@ -95,7 +95,7 @@ export class UserCenterComponentsDriverComponent implements OnInit { nzWidth: 900, nzComponentParams: { extendType: '3', - businessId: item.id + businessId: item.appUserId }, nzFooter: null }); @@ -301,9 +301,10 @@ export class UserCenterComponentsDriverComponent implements OnInit { title: '操作', width: '110px', className: 'text-center', + fixed:'right', buttons: [ { - text: '查看', + text: '查看
', click: item => { this.router.navigate(['./detail', item.appUserId], { relativeTo: this.ar }); // this.router.navigate(['./view', item.id], { relativeTo: this.ar, queryParams: { tenantId: item.tenantId } });