问题描述
vue-cli 项目中 proxyTable 设置代理报错 请求接口报错404,
为什么后端把products 改为 merchantsProducts就OK了,
而且,项目中没有其他重名的 products ,只有一个为 product 的接口
问题出现的环境背景及自己尝试过哪些方法
'/products': {
target: 'http://172.16.69.109:7071/products/',
changeOrigin: true,
pathRewrite: {
'^/products': ''
}
},
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
代理部分
'/merchantsProducts': {
target: 'http://172.16.69.109:7071/merchantsProducts/',
changeOrigin: true,
pathRewrite: {
'^/merchantsProducts': ''
}
},
请求部分
selectGoods(){
let that = this;
that.$http.post("/merchantsProducts/get", {
currentPage:that.currentPage,
pageSize:that.page_size,
title:that.titles,
shopsId:that.storeId,
productId:''
}).then(res => {
that.total = res.data.total
that.goodsList = res.data.dataList;
console.log(that.goodsList)
});
},
你期待的结果是什么?实际看到的错误信息又是什么?
返回错误404
### 题目描述
题目来源及自己的思路
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
你期待的结果是什么?实际看到的错误信息又是什么?
问题描述
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)