webpack的proxytable的配置


這個一定不能忘記了/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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM