首页 > Web开发 > 详细

webpack的proxytable的配置

时间:2018-10-23 19:42:39      阅读:295      评论:0      收藏:0      [点我收藏+]

技术分享图片

这个一定不能忘记了/rest/后面的/,否则就是404找不到接口

这样的实现效果是

this.axios.post(‘/api/delShare‘, qs.stringify({‘Id‘:Number(id)})).then(res=>{
     if(res.data.status=="success"){
         alert(res.data.msg);
         _this.getData();
      }
}).catch(err=>{
console.log(err);
});
 
请求效果:
localhost:7086/api/delShare     =>   http://test.weioutech.com/rest/delShare
 
技术分享图片
 
请求效果:
localhost:7086/api/delShare     =>   http://test.weioutech.com/delShare

webpack的proxytable的配置

原文:https://www.cnblogs.com/liyusmile/p/9838217.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!