你好,fetch怎样解决跨域呢?

来源:4-11 异步Action(2)

慕瓜7451645

2019-07-10

Access to fetch at ‘http://localhost:5000/’ from origin ‘http://172.203.160.88:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

写回答

1回答

艾特老干部

2019-07-11

你好,可以通过设置代理的方式解决跨域问题,课程第2章Mock数据中有介绍。

0
0

React16+Redux实战企业级大众点评Web App

从架构设计到部署上线,带你学习React技术栈与核心思想

1071 学习 · 306 问题

查看课程