Access to XMLHttpRequest at from origin 'null' has been blocked by CORS policy:
Access to XMLHttpRequest at 'file:///F:/vue/vue20200414/%E5%BD%92%E6%A1%A3/%E5%BD%92%E6%A1%A3/04%20day_vue/axios2.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are on
·
Access to XMLHttpRequest at 'file:///F:/vue/vue20200414/%E5%BD%92%E6%A1%A3/%E5%BD%92%E6%A1%A3/04%20day_vue/axios2.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
错误原因:函数方法,或者数据有问题,拷贝官方会减少出现
比如缺少斜杠、方法名使用错误
this.$axios.default.baseURL = 'http://127.0.0.1:8888';
上面default需要改为defaults
有人baseURL 写成baseURI
更多推荐
已为社区贡献8条内容
所有评论(0)