小程序预览执行的错误,在微信工具上没问题?-灵析社区

来自武功山的爱

我用的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; } ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20241124/7b468eb06faecb68eac159d300dd8249.png) 如果我把catch去掉,会提Code有问题,我怎么感觉是这个接口压根没有走呀?有人遇到过没?微信开发工具上正常。

阅读量:25

点赞量:0

问AI
爱打瞌睡的三角龙
小程序request合法域名添加了吗?