Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取微信小程序手机号 #3

Open
bienvenidoY opened this issue Apr 27, 2018 · 0 comments
Open

获取微信小程序手机号 #3

bienvenidoY opened this issue Apr 27, 2018 · 0 comments

Comments

@bienvenidoY
Copy link
Owner

自建node服务器解密小程序手机号

换取手机号流程

获取微信用户绑定的手机号,需先调用login接口,获得code,服务器使用 code 换取的 sessionKey ,然后用户点击授权手机号操作后,前端将获取的iv,encryptedData发送给服务端进行解密,返回解密结果。

问题

  • error:Illegal Buffer

    开始解密的时候遇到这个问题,感觉自己的数据都是正确的,后来重新看了一遍,是自己有问题 =.=!

例子

  • 截图

2018-04-27 6 03 30

  • 实现代码
    代码地址 查看wechat分支
    https://github.com/bienvenidoY/nodeapi-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant