学习大纲
做vue项目出现下面这个报错怎么办
:8081/#/:1 Failed to load https://news-at.zhihu.com/api/4/news/latest: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. Error: Network Error at createError (createError.js?16d0:16) at XMLHttpRequest.handleError (xhr.js?ec6c:87)
怎么解决呢?
1.1.只需要在浏览器中加这个插件就可以了
1.Allow-Control-Allow-Origin: *
博主联系方式:
- 微信:34419369
- QQ: 34419369
- 公众号:前方录
- 有什么不懂的地方欢迎联系我,帮到你是我会很开心