https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html ,微信小程序基础库版本已经是2.22.0了 但是调用获取手机号这个api,返回得出参是原先老版本的encryptedData,errMsg,iv。
获取手机api,获取不到codeGet the mobile phone api, but can't get the code
获取手机api,获取不到codehttps://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html ,微信小程序基础库版本已经是2.22.0了 但是调用获取手机号这个api,返回得出参是原先老版本的encryptedData,errMsg,iv。
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html , the version of wechat applet basic library is 2.22.0, but call the API to obtain the mobile phone number, and the returned parameter is the old version of encrypteddata, errmsg, IV.
回答:
无code自行排查:
① 确认当前基础库版本是否为 2.21.2 及以上。
② 目前开发者工具稳定版未兼容此表现(近期应该会同步)。
③ 正常情况下,基础库 2.21.2
对应的是客户端版本号为 8.0.16
,如果你的版本低于 8.0.16
并且是通过开发者工具向客户端推送的 2.21.2
基础库,大几率不会返回 code
参数,请手动更新微信版本。
目前请先用 开发版 或者 真机 进行调试。
开发者工具也需要更新
原文出处:获取手机api,获取不到code
开发者工具升级到最新版