小程序已经绑定到开放平台,但小程序jscode2session方法依然不返回unionid,有解吗?

小程序 文章 2020-08-14 01:21 2832 0 全屏看文

AI助手支持GPT4.0

小程序已经绑定到开放平台,但小程序jscode2session方法依然不返回unionid,有解吗?The applet has been bound to the open platform, but the jscode2session method of the applet still does not return unionid. Is there a solution?

小程序已经绑定到开放平台,但小程序jscode2session方法依然不返回unionid,有解吗?

如题,开放平台已经开通认证,小程序也是上线版本,两者是同一个主体,但是小程序绑定到开放平台后,在后端调用jscode2session,依然只返回openid,不会返回unionid,怎么处理呢?

想一开始就获取到unionid,为以后上APP做准备。

For example, authentication has been opened on the open platform, and the applet is also the online version. The two are the same subject. However, after the applet is bound to the open platform and calls jscode2 session in the back end, it still only returns openid and does not return unionid. What should I do? I want to get unionid at the beginning to prepare for the app in the future.

回答:

江桥月:

。。。。。

这都是啥回答呀,误人子弟

小程序获取unionid只需要小程序绑定到开放平台就行了,别的啥也不需要,你别听他们误导你,什么啊

只不过你不能简单的通过jscode2session来获取了而已

你需要用button让用户授权然后拿到encryptedData和iv 然后传到后台结合session_key来解密用户信息,解密出来的数据就一定有unionid

神奇的桑桑😄😄😄:必须用户在两个端口都授权才可以获取unionid。
拾忆:

必须满足条件,单独一个小程序获取不到unionid

Lew:多谢回复,请问,最简单的解决办法是怎么搞呢?去里面提交一个未上线的安卓APP,可以吗?
拾忆:方案1从解密数据里获取unionid估计是你唯一的方案了

-EOF-

AI助手支持GPT4.0