请看下面我的回答(下客介),来个人帮帮,不想再熬夜了。感谢
不懂后端,望提供前端可以解决的方案,感谢
1-fetch跨域请求"聚合数据"提供的新闻API,报“ No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.”
2-相关代码段
webpack.config.js片段:
安装了:
var proxy = require('http-proxy-middleware');
require('es6-promise').polyfill();
require('isomorphic-fetch')
xxx.js片段:
3-浏览器console与network截图:
守候你守候我
偶然的你
繁星淼淼
相关分类