我的应用程序状态出错。 它的状态为401,且token_expired错误 但是在HttpInterceptor中,它的接收状态为0,而没有错误(token_expired)
refresh-token.interceptor.ts
constructor(private injector: Injector) { }
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(request)
.pipe(
catchError((errorResponse: HttpErrorResponse) => {
const error = (typeof errorResponse.error !== 'object') ? JSON.parse(errorResponse.error) : errorResponse.error;
console.log("Status: "+errorResponse.status);
console.log(error.error);
if (errorResponse.status === 401 && error.error === 'token_expired') {
}
return throwError(errorResponse);
})
)
}