1***@qq.com
1***@qq.com
  • 发布:2021-12-27 15:13
  • 更新:2022-06-23 10:55
  • 阅读:1045

uni-app H5端 中的uni.request 在手机端的百度浏览器 报错 有些接口报 request: fail 是h5网页

分类:uni-app

uni-app H5端 中的uni.request 在手机端的百度浏览器 报错 有些接口报 request: fail

   request(url, method = 'GET', data = {}, success, fail) {  
        return new Promise((resolve, reject) => {  
            if (isShowLoad) {  
                uni.showLoading({  
                    title: "加载中...",  
                    mask: true  
                })  
            }  
            uni.request({  
                method: method,  
                url: url,  
                data: data,  
                header:{'Content-Type':'application/x-www-form-urlencoded'},  
                dataType:"json",  
                success: (res) => {  
                    if(this.checkResponse(res,url)){  
                        success(res.data);  
                    }else{  
                        fail(res);  
                    }  

                },  
                fail: (err) => {  
                    uni.showModal({  
                        title: '提示',  
                        content: JSON.stringify(err),  
                        showCancel: false,  
                    });  
                    fail(err);  
                },  
                complete: () => {   
                    try {  
                        setTimeout(()=>{uni.hideLoading();},300)  

                    } catch (e) {  
                        //TODO handle the exception  
                    }  

                }  
            })  
        })  
    }  

调用获取轮播图接口的时候 报错
request: fail
但是在其他浏览器没有这个问题,百度浏览器上有时可以有时又不行

2021-12-27 15:13 负责人:无 分享
已邀请:
I***@163.com

I***@163.com

兄弟,解决了吗?

要回复问题请先登录注册