vue 处理跨域问题 (“No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.”)
服务端
设置请求头 允许跨域
JQuery
添加 dataType: 'jsonp'
axios
设置代理
找到config/index.js,在dev(本地)中添加 或者 build(打包线上)中 添加 如下代码
使用 以 /api 开头 则会进入proxyTable
设置请求头 允许跨域
添加 dataType: 'jsonp'
设置代理
找到config/index.js,在dev(本地)中添加 或者 build(打包线上)中 添加 如下代码
使用 以 /api 开头 则会进入proxyTable