作者:手机用户2502860581 | 来源:互联网 | 2023-01-28 09:26
1> bsorrentino..:
我认为有关反应流的问题.该方法拦截预计将返回一个可观察,你必须扁平化与您的异步结果可观察到由返回next.handle
试试这个
intercept(req: HttpRequest, next: HttpHandler): Observable> {
return this.asyncService.applyLogic(req).flatMap((modifiedReq)=> {
const newReq = req.clone(modifiedReq);
return next.handle(newReq);
});
}
您也可以使用switchMap而不是flatMap