关于whatwg-fetch cookie 跨域问题

reponse headers

Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:X-Requested-With,X-Request-Id
Access-Control-Allow-Methods:GET,POST,PUT,DELETE,OPTIONS
Access-Control-Allow-Origin:http://dev.api.test.com

我在test.com 域下调用 dev.api 的接口 需要把cookie 带过去 我的fetch 使用是

FETCH(_url, {

        method: 'GET',
        headers: {
            'X-Request-Id': GUID()
        },
        credentials: 'include'

}

但是请求dev接口的时候 并没有带上test.com下的cookie , 不知道是哪里写错了,麻烦看看

阅读 4.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进