1.在config/index.js:
proxyTable: {
'/api': {
target: 'http://192.168.10.000:8066',//api地址
changeOrigin: true,
pathRewrite: {
'^/api': '/'
}
}
},
2.页面使用:
this.$axios.post("/api/signin",loginParams).then(data=>{
}).catch(err=>{
})
3.配置完之后重新运行 npm run dev