美文网首页
fetch(isomorphic-fetch) 跨域问题

fetch(isomorphic-fetch) 跨域问题

作者: 李莫愁_melissa | 来源:发表于2017-08-09 09:46 被阅读0次

多的不说直接上代码

fetch('https://news-at.zhihu.com/api/4/news/latest',{

        credentials: 'include',

        herders: {

              'Access-Control-Request-Method': '*'

        },

       mode: 'no-cors'

}). 

//////////////////////// 一个promise结构 ///////////////////////

最核心部分:

herders: {

'Access-Control-Request-Method': '*'

},

加了这几行,保你跨过千山万水!

相关文章

网友评论

      本文标题:fetch(isomorphic-fetch) 跨域问题

      本文链接:https://www.haomeiwen.com/subject/dadfrxtx.html