这是官方的
这是我的
请仔细对照文档排查一下:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
在回调中调用 wx.login 登录,可能会刷新登录态。此时服务器使用 code 换取的 sessionKey 不是加密时使用的 sessionKey,导致解密失败。建议开发者提前进行 login;或者在回调中先使用 checkSession 进行登录态检查,避免 login 刷新登录态
login
checkSession
解决了吗???