我想从Angular5项目向服务器发送http会话cookie 我发现我必须将withCredentials设置为true但它根本不起作用 这是HttpClient的拦截
intercept(req: HttpRequest<any>, next: HttpHandler):
Observable<HttpEvent<any>> {
req = req.clone({
setHeaders: {
Authorization: `Bearer ${localStorage.getItem('token')}`
},
withCredentials:true
});
return next.handle(req);
}