我这解密出来的数据没有手机号信息啊,还是只有用户头像的基础信息,请问是基础库的版本问题吗?

小程序 文章 2022-02-16 14:40 279 0 全屏看文

AI助手支持GPT4.0

我这解密出来的数据没有手机号信息啊,还是只有用户头像的基础信息,请问是基础库的版本问题吗?The data I decrypted has no mobile phone number information, or only the basic information of the user's avatar. Is it a problem with the version of the basic library?

我这解密出来的数据没有手机号信息啊,还是只有用户头像的基础信息,请问是基础库的版本问题吗?
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug 获取手机号的api 微信安卓客户端 8.0.16 2.19.6

需要将 button 组件 open-type 的值设置为 getPhoneNumber,当用户点击并同意之后,可以通过 bindgetphonenumber 事件回调获取到微信服务器返回的加密数据, 然后在第三方服务端结合 session_key 以及 app_id 进行解密获取手机号。

Framework type problem type API / component name terminal type wechat version basic library version applet bug API wechat Android client 8.0.16 2.19.6 needs to set the value of button component open type to getphonenumber. After the user clicks and agrees, the encrypted data returned by wechat server can be obtained through bindetphonenumber event callback, Then combine session with the third-party server_ Key and app_ Decrypt the ID to obtain the mobile phone number.

回答:

brave:

encryptedData 传错了

代码怎么写的贴一下

军少:您说的对,我改过来了,现在已经成功拿到手机号了,多谢
小黎:

换一下基础库,或者看下最新获取手机号的方法https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html

军少:换了,没有用啊,我是用的最新的方法获取手机号来着,现在小程序端让我改到旧版本去啊
军少:

请问,有人知道为啥嘛

-EOF-

AI助手支持GPT4.0