From 306952a85028ae185a99adfc865196a52c8574c4 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Thu, 10 Feb 2022 09:24:09 +0800 Subject: [PATCH] edit --- src/app/core/guards/auth.guard.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/core/guards/auth.guard.ts b/src/app/core/guards/auth.guard.ts index 136c975a..8beda134 100644 --- a/src/app/core/guards/auth.guard.ts +++ b/src/app/core/guards/auth.guard.ts @@ -41,11 +41,12 @@ export class AuthGuard extends ACLGuard { } canActivate(route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable { - if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) { - return super.canActivate(route, _state); - } else { - return super.canActivate(route, _state); - } + // if (Object.keys(route.params)?.length > 0 || !route.routeConfig?.path) { + // return super.canActivate(route, _state); + // } else { + // return super.canActivate(route, _state); + // } + return super.canActivate(route, _state); } canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { @@ -69,11 +70,6 @@ export class AuthGuard extends ACLGuard { return this.baseService.request('/api/mdc/cuc/functionButton/getUserFunctionButton', { link: router }).pipe( switchMap(res => { if (res) { - // if (router === '/ticket/invoice-requested') { - // this.srv1.setAbility(['TICKET-INVOICE-REQUESTED-list']); - // } else { - // this.srv1.setAbility(res.abilities || []); - // } this.srv1.setAbility(res.abilities || []); // this.menuService.resume(); } @@ -86,6 +82,12 @@ export class AuthGuard extends ACLGuard { ); } + /** + * 根据参数拼接原始路由 + * @param params 参数 + * @param route 实际路由 + * @returns + */ private settingRoute(params: any, route: string) { let _route = route; if (_route.indexOf('?') > -1) {