问题描述
我这样写在自己电脑都没问题的,但是在测试那边测试就有问题了的,我查资料说加上个catch,但这样我的请求是否还能返回想要的数据呢??
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
var jsondata=JSON.stringify(dataInfo);
this.hide=true;
this.$http.post(seajs.data.base +'price/calcAmount.do?custId='+this.custId, jsondata, {emulateJSON: false}).then(
data => {
if(data.data.code==200){
this.total=data.data.data.total;
this.postInfo=data.data.data.dataList;
console.log(data.data);
}else{
this.$Message.info(data.data.msg);
return false;
}
}
).catch(e){
console.log(e);
};
你这个是不是接口地址写错了?http://127.0.0.1???