• Home
  • Archives
  • About
  • Github
  • zh


fetch遇到了一个坑

fetch 在跨域的情况下,不带cookie;

解决办法:

带上参数{credentials: ‘include’}后才可以在请求里面带上cookie

fetch('doAct.action', {credentials: 'include'}).then(function(res) {
    // ...
})

微信公众号

本文链接:

https://alili.tech/archive/d82a6654/

# 最新文章