为了账号安全,请及时绑定邮箱和手机立即绑定

fetch 跨域请求问题!

fetch 跨域请求问题!

凤凰求蛊 2018-10-19 14:09:06
var urls = [    "xxxxxx",    "xxxxxxxxx"];function(urls) {    return Promise.all(urls.map(url =>        fetch(url,{          mode: "no-cors",          headers:  {                      "Content-Type": "text/html;charset=UTF-8",                    }        }).then((response) => {            console.log(response);            if (response.ok) {                return response.text();            } else {                return {status:response.status};            }        })      )).catch((err)=> {          return {status:-1};      })}跨域请求数据已经拿到,但是response的状态是false是为什么?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1512 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信