[英]Angular interceptor 302 response
我在現有的 Angular 11 應用程序中添加了 http 攔截器。
我們有 2 個請求加載,它們按預期工作,但是當我添加沒有邏輯的攔截器時,只返回相同的請求,一個請求開始拋出 302 found 狀態。
所以,我不明白我應該如何解決這個問題,或者是否有一個走動。
謝謝你的幫助
import { Injectable } from '@angular/core'; import { HttpInterceptor, HttpEvent, HttpResponse, HttpRequest, HttpHandler } from '@angular/common/http'; import { Observable } from 'rxjs';
@Injectable() export class MyInterceptor implements HttpInterceptor { intercept(httpRequest: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(httpRequest); } }
我想你錯過了什么。 請仔細閱讀這篇文章,然后檢查。 我希望這對你有用 https://ultimatecourses.com/blog/intro-to-angular-http-interceptors
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.