如题,开放平台已经开通认证,小程序也是上线版本,两者是同一个主体,但是小程序绑定到开放平台后,在后端调用jscode2session,依然只返回openid,不会返回unionid,怎么处理呢?
想一开始就获取到unionid,为以后上APP做准备。
小程序已经绑定到开放平台,但小程序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
。。。。。
这都是啥回答呀,误人子弟
小程序获取unionid只需要小程序绑定到开放平台就行了,别的啥也不需要,你别听他们误导你,什么啊
只不过你不能简单的通过jscode2session来获取了而已
你需要用button让用户授权然后拿到encryptedData和iv 然后传到后台结合session_key来解密用户信息,解密出来的数据就一定有unionid