问题描述
所以我用这样的代理调用api:
vue.config.js :
module.exports = {
devServer: {
proxy: {
'^/service/': {
target: 'http://localhost:8181/',changeOrigin: true,secure:false,pathRewrite: {'^/service': '/service/'},logLevel: 'debug'
}
}
}
}
xx.vue:
getDetails(){
axios.get('/service/details/')
.then(response => this.version = response.data.details)
我想从 http://localhost:5471/service/details 获取一些数据,路径相同 /service/details 但端口 5471 不同,如何将其添加到代理中?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)