axios报错
axios报错代码:
Access to XMLHttpRequest at 'file:///C:/adel?id=555' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
DELETE file:///C:/adel?id=555 net::ERR_FAILED
axios.js:1207 Uncaught (in promise) Error: Network Error
at createError (axios.js:1207)
at XMLHttpRequest.handleError (axios.js:1059)
DevTools failed to load SourceMap: Could not load content for file:///C:/Users/lenovo/Desktop/js/08-vue/03-%E4%BA%A4%E4%BA%92/axios.map: System error: net::ERR_FILE_NOT_FOUND
报错信息:
解决:
原因是在给axios配置地址时,没有在前面加上
http://localhost:3000
加上即可解决