1、axios請求withCredentials: true | axios.defaults.withCredentials = true(跨域請求帶上cookies)
let param = {};
param.cardNo = "test02";
axios
.get(global_config.BASE_URL_U + "/webService/getReaderInfo", {
params: param,
withCredentials: true
})
.then(function(response) {
debugger;
let result = response.result;
});
2、vue_cli 設置代理
proxyTable: {
"/webService": {
target: "http://opac.jxlibrary.net:8082",
changeOrigin: true,
// pathRewrite: {
// '^/api': '/' //重寫接口,可以爲空'',也可以爲'/'
// }
}
},