Mini Program can get openid without authorization. Why do you want to decrypt getUserInfo and get openid again?

at present, after logging in and reading WeChat Mini Programs"s documents, you can get the user"s openid and session_key on the server interface without authorization with wx.login. Then the first login of user information calls up authorization with the open-type button, and the second login uses wx.getUserInfo. The openids of user information needs to be decrypted with encryptedData and session_key to obtain openid. It doesn"t work here, because if you get session_key, you already get openid, so why do you need to decrypt it again to get openid?

Jul.14,2022

if all you need is openid, you don't need to call getUserInfo

Menu