const getUserProfile = await awx.getUserProfile({desc: '用于完善会员资料'});
const { code } = await awx.login()
let url = ""
let params = {
code:code,
encryptedData:getUserProfile.encryptedData,
iv:getUserProfile.iv
}
http (url,params,"POST").then((res) => {
console.log(res)
})
因为改版获取用户信息之后,必须在点击事件里先进行获取用户信息wx.getUserProfile,之后才能用wx.login获取code,最后调取接口,把code,iv,encryptedData传给后台,这样会偶发性的出现解密失败的情况,官方大大,怎么解决呀!!!
getUserProfile方法获取了用户信息,无需解密用户基本数据了呀,只要调用wx.login获取登录凭证code直接也可以拿到unionid,这个两个没有必然的联系吧,你让后台同事检查一下code2Session业务逻辑,能拿到用户信息和unionid,还需要其他数据么?
我代码里也写一起,没出现过code和iv一起用会解密失败的情况
现在wx:login 可以直接调用啊