处理跨域问题: 注意点:index.js里面 如果设置统一值 的medtionHost不能放在vue.config.js中
1.在vue.config.js中 加
在desServer里面加
proxy: {
“^/ocs”: {
target: “http://www.medtion.com/ocs”, //目标接口域名 // secure: false, //false为http访问,true为https访问
changeOrigin: true, //是否跨域
pathRewrite: {
“^/ocs”: “”, //重写接口
},
},
},
注意点:ocs 对应url的ocs 相对应