fetch在发送跨域请求的时候默认是不带cookie的,此时服务器也不能通过“set-cookie”让浏览器生成cookie。
可以通过设置credentials
为include
来解决这个问题。
传统 Ajax 已死,Fetch 永生: https://github.com/camsong/blog/issues/2
——我要我想要的
fetch在发送跨域请求的时候默认是不带cookie的,此时服务器也不能通过“set-cookie”让浏览器生成cookie。
可以通过设置credentials
为include
来解决这个问题。
传统 Ajax 已死,Fetch 永生: https://github.com/camsong/blog/issues/2