SUPPORT-8897: Fix
This commit is contained in:
parent
34c8108ee6
commit
5d18105459
3 changed files with 4 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import {Injectable} from "@angular/core";
|
||||||
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from "@angular/router";
|
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from "@angular/router";
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {HttpClient, HttpParams} from "@angular/common/http";
|
import {HttpClient, HttpParams} from "@angular/common/http";
|
||||||
import {MessagesService} from "@webbpm/base-package";
|
import {MessagesService, ErrorMessageService} from "@webbpm/base-package";
|
||||||
import {AuthenticationService} from "../authentication.service";
|
import {AuthenticationService} from "../authentication.service";
|
||||||
import {EsiaErrorDetail} from "../EsiaErrorDetail";
|
import {EsiaErrorDetail} from "../EsiaErrorDetail";
|
||||||
|
|
||||||
|
|
@ -13,7 +13,8 @@ export abstract class AuthGuard implements CanActivate {
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private authenticationService: AuthenticationService,
|
private authenticationService: AuthenticationService,
|
||||||
private messageService: MessagesService
|
private messageService: MessagesService,
|
||||||
|
private errorMessageService: ErrorMessageService
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,7 +49,7 @@ export abstract class AuthGuard implements CanActivate {
|
||||||
? reason.error.messages
|
? reason.error.messages
|
||||||
: reason.error.replaceAll('\\', '');
|
: reason.error.replaceAll('\\', '');
|
||||||
if (error) {
|
if (error) {
|
||||||
errorMessage = 'Система временно недоступна. Пожалуйста, повторите попытку позже.';
|
errorMessage = this.errorMessageService.getErrorMessage();
|
||||||
let errorCode = this.extractCode(errorDescription);
|
let errorCode = this.extractCode(errorDescription);
|
||||||
if (errorCode) {
|
if (errorCode) {
|
||||||
errorMessage = EsiaErrorDetail.getDescription(errorCode);
|
errorMessage = EsiaErrorDetail.getDescription(errorCode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue