A.我要请求的地址:
http://qq1.aaa.com:8080/qqGroups/info
B.
1.webpack里配置如下
proxyTable: {
'/api': {
target: 'http://qq1.aaa.com:8080',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
2.请求
this.$axios.get('/api/qqGroups/info').then(function(response) {
console.log(response);
}).catch(function(error) {
console.log(error);
});
3.GET http://localhost:8080/api/qqGroups/info 404 (Not Found)
提示可见 配置无效
C:https://vuejs-templates.githu...
官方文档也是这么配置的啊
简直日了方圆500里的狗,搭的新环境都不行
粗略一看应该是没问题的,你可以先确定一下是否是以下问题:
1、请求服务器自己能不能调用这个接口
2、请求服务器是否开了防火墙