vue+react 请求不到接口数据-ERROR:跨源请求:同源策略禁止读取位于 http://localhost:8888/department/findAll 的远程资源。(原因:CORS
报错:
已拦截跨源请求:同源策略禁止读取位于 http://localhost:8888/department/findAll 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。
配置:
前端: axios.js
// 1. axios的默认配置
axios.defaults.baseURL = "http://localhost:8888"
axios.defaults.headers["Content-Type"]= "applicatio
原创
2020-05-25 20:52:25 ·
729 阅读 ·
0 评论