小编foc*_*och的帖子

Angular2替换$ httpProvider.defaults.withCredentials

我有与问题完全相同的问题,但对于Angular 2.

总而言之,当向另一个域发送HTTP请求时,即使正确设置了CORS头,也不会发送JSESSIONID cookie.Angular 1.x解决方案是设置以下配置:

.config(function ($routeProvider, $httpProvider) {
    $httpProvider.defaults.withCredentials = true;
    //rest of route code
Run Code Online (Sandbox Code Playgroud)

但是我找不到Angular 2的任何替代解决方案.

任何的想法?谢谢!

angularjs angular

5
推荐指数
1
解决办法
3056
查看次数

标签 统计

angular ×1

angularjs ×1