第一次调用wx.login失败,提示login:fail login no response,之后每次都提示login:fail login no response,都获取不到code
手机型号iphoen10,用的是uni-app
看到社区里也有几个类似的帖子,都是ios系统才会出现,哪怕是一个月登录一次也有会出现这种情况,官方没有什么方案可以避免这种情况的吗?
uni.login({
provider: 'weixin',
timeout: 3000,
success: wxres => {
console.log('微信code', wxres);
if (wxres.code) {
// 进行post 请求
}
},
fail: (err) => {
console.log(err, 'code 获取失败');
uni.showToast({
title: 'weixin code获取失败',
icon: 'none'
})
}
})
从图中看着像短时间调用很多次 wx.login,减少使用wx.login次数再重试看看
可以参考文档 接口调用频率规范
https://developers.weixin.qq.com/miniprogram/dev/framework/performance/api-frequency.html