fetch遇到了一个坑
fetch 在跨域的情况下,不带cookie;
解决办法:
带上参数{credentials: ‘include’}后才可以在请求里面带上cookie
fetch('doAct.action', {credentials: 'include'}).then(function(res) {
// ...
})
微信公众号
![](https://incomparable9527.coding.net/p/imageBed/d/imageBed/git/raw/master/c2a91cfb597826a4b02b755746c300e00cc7728a9f5bac20bec538e8c76a443f.png)
fetch 在跨域的情况下,不带cookie;
解决办法:
带上参数{credentials: ‘include’}后才可以在请求里面带上cookie
fetch('doAct.action', {credentials: 'include'}).then(function(res) {
// ...
})