部分机型调用接口fail
很多手机都会调用这个接口,目前观测到如下两台手机会一直fail,其他手机都是正常调用成功。
机型1为:微信版本:6.5.16 手机:1+ A0001 andriod 版本:4.3
机型2为: 微信版本:6.5.13 手机:华为M7 andriod的版本4.4.2
这是体验者版本下,都添加了体验者权限。在调用接口时一直fail,请问能否解决这一兼容问题,代码如下:
wx.showLoading({
title: ‘登录中’,
mask:true
})
//下面的url是一个全局变量,这个已经打印出来过了。
wx.request({
url: url + ‘/userInfo/activeCodeLogin?phone=’ + that.data.phone + ‘&activeCode=’ + that.data.code,
method: ‘POST’,
header:{
‘request’: ‘wechat’,
‘content-type’: ‘application/json’
},
success: function (res) {
console.log(res)
wx.hideLoading()
if (res.data.httpCode === 200) {
wx.setStorage({
key: ‘userId’,
data: res.data.data.userId,
})
wx.redirectTo({
url: ‘…/changePassword/changePassword?type=2&activeCode=’ + that.data.code + ‘&phoneNum=’ + that.data.phone,
})
} else {
that.setData({
showAlert: true, //showmodal
alertLoadInf: res.data.msg || ‘邀请码或手机号错误’ //showmodal信息
})
}
},
fail: function () {
wx.hideLoading()
that.setData({
showAlert: true, //showmodal
alertLoadInf: ‘服务器错误,请稍后重试’ //showmodal信息
})
},
complete:function(){
}
})
