edit
This commit is contained in:
@ -5,7 +5,7 @@ import {
|
||||
HttpInterceptor,
|
||||
HttpRequest,
|
||||
HttpResponse,
|
||||
HttpResponseBase,
|
||||
HttpResponseBase
|
||||
} from '@angular/common/http';
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
|
||||
@ -21,7 +21,7 @@ export class BusinessInterceptor implements HttpInterceptor {
|
||||
private eaUserSrv: EAUserService,
|
||||
@Optional()
|
||||
@Inject(DA_SERVICE_TOKEN)
|
||||
private tokenSrv: ITokenService,
|
||||
private tokenSrv: ITokenService
|
||||
) {}
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
// 构造新的请求URL
|
||||
@ -30,8 +30,8 @@ export class BusinessInterceptor implements HttpInterceptor {
|
||||
req = this.attachAdditionalHeaders(req);
|
||||
// 后续操作
|
||||
return next.handle(req).pipe(
|
||||
mergeMap((ev) => this.handlingBussinessResponseData(ev)),
|
||||
catchError((err: HttpErrorResponse) => this.handlingBusinessErrors(err)),
|
||||
mergeMap(ev => this.handlingBussinessResponseData(ev)),
|
||||
catchError((err: HttpErrorResponse) => this.handlingBusinessErrors(err))
|
||||
);
|
||||
}
|
||||
|
||||
@ -56,6 +56,7 @@ export class BusinessInterceptor implements HttpInterceptor {
|
||||
const header: any = {
|
||||
appId: this.envSrv.env.appId,
|
||||
tenantId: this.envSrv.env.tenantId,
|
||||
enterpriseId: '0'
|
||||
};
|
||||
|
||||
// 附加授权声明
|
||||
|
||||
Reference in New Issue
Block a user