module.exports = {
baseUrl: './',
assetsDir: 'static',
productionSourceMap: false,
devServer: {
proxy: {
'/api':{
target:'https://www.aabb.com/',
changeOrigin:true,
pathRewrite:{
'/api':''
}
}
}
}
}
假设访问的地址是
let url = "https://www.aabb.com/shangpucz/0/?PGTID=0d306b31-0000-011f-b003-005524cf3a22&ClickID=1";
实际请求
axios.get("/api/shangpucz/0/?PGTID=0d306b31-0000-011f-b003-005524cf3a22&ClickID=1")
.then((res) => {
console.log(res);
});