向后台发送请求现在的写法this.$http.get('http://1.1.1.1:8080/product/getAllProducts?page=0').then((response)=>{me.tableData=response.body.data.content}).catch(function(response){/***todo:此处待补充错误处理**/})我希望改成下面写法但是效果还是http://1.1.1.1:8080/product/getAllProducts?page=0this.$http.get('product/getAllProducts?page=0').then((response)=>{me.tableData=response.body.data.content}).catch(function(response){/***todo:此处待补充错误处理**/})为此,我改了config/index.js文件中的dev:{proxyTable:{'/api':{target:'http://1.1.1.1:8080',changeOrigin:true}}但是并不能实现我想要的效果,求助求助注意:我用的是vue-resource,怎么写呢?而且我就是开发模式下请求需要指定地址,在build模式下正常使用localhost
沧海一幻觉
相关分类