我不知道我在项目中添加了什么,所有错误都这样记录:
POST http://xx.xx.xx.xx:3000/auth/login 401 (Unauthorized).........................zone-evergreen.js:2845
TypeError: scheduler.schedule is not a function....................................auth.service.ts:58
at Observable._subscribe (throwError.js:7)
at Observable._trySubscribe (Observable.js:42)
at Observable.subscribe (Observable.js:28)
at subscribeToResult (subscribeToResult.js:9)
at CatchSubscriber.error (catchError.js:38)
at XMLHttpRequest.onLoad (http.js:2533)
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Object.onInvokeTask (core.js:41814)
at ZoneDelegate.invokeTask (zone-evergreen.js:398)
at Zone.runTask (zone-evergreen.js:167)
这是打印此代码的简单示例:
login(data) {
return this.http.post<any>(`${this.BASE_URL}/auth/login`, data).pipe(
catchError(err => {
console.error(err);
return throwError(err);
}
)).subscribe(res => console.log(res));
}
当我在chrome devtools的网络标签中跟踪网址时,我发现错误消息是从srver发送的。>
我不知道我在项目中添加了什么,所有错误都被记录为POST http://xx.xx.xx.xx:3000 / auth / login 401(未经授权)...... .............. zone-evergreen.js:2845 TypeError:Scheduler ....
catchError(err => { console.error(err); return throwError(err); }