这种bug是什么原因?跨域问题吗,用的axios,怎么解决呢

浏览器报错
https://img1.mukewang.com/5c6674e70001570f08000072.jpg

Failed to load http://10.4.8.7......: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8009' is therefore not allowed access.
createError.js?f777:16 Uncaught (in promise) Error: Network Error

at createError (createError.js?f777:16)
at XMLHttpRequest.handleError (xhr.js?14ed:87)

在postman测试接口可以返回数据

https://img1.mukewang.com/5c6674e90001d95507570320.jpg

紫衣仙女
浏览 1205回答 1
1回答

侃侃尔雅

跨域问题,服务端把CORS配置好,或者用node做代理层访问API
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript