我用的uniapp开发的,就下面的代码,也是这个页面内调的第一个接口,在微信工具上没什么问题,但是“预览”用手机,却提示下面的错误:
console.log('a')
const res = await this.$http({
url: '/CollectionDoc/GetDocInfoById',
method: 'POST',
data
}).catch(e=>{
console.log('b')
this.emptyLoading=false;
this.doctorData = {}
})
if (res.Code == 0) {
console.log('c')
this.doctorData=res.Data
this.emw=res.Msg
this.emptyLoading=false;
}else{
console.log('d')
this.emptyLoading=false;
}
如果我把catch去掉,会提Code有问题,我怎么感觉是这个接口压根没有走呀?有人遇到过没?微信开发工具上正常。
小程序request合法域名添加了吗?