如题,急急急,跪求帮助!
appid:wx4f2f76fbdeec9459
未登录过公众号之类的用户直接登录小程序,已经进行授权,还是获取不到unionid,求解
网友回复:
unionid需要第三方平台介入才能获取到:https://open.weixin.qq.com/
已经第三方平台介入了,之前是做公众号的,原先公众号的用户进入小程序全都没有问题,正常获取,新用户获取不到
$this->Code = $param['code'];
$this->Iv = $param['iv'];
$this->EncryptedData = $param['encryptedData'];
$data = $this->getSessionKey();
if(!isset($data['errcode']))
{
$this->SessionKey = $data['session_key'];
}
else
{
$this->returnApi(array(),$data['errcode'],$data['errmsg']);
}
$this->Openid = $data['openid'];
$a = $this->decryptData( $this->EncryptedData,$this->Iv );
基本获取步骤
需要解密下信息才可以
$this->Code = $param['code'];
$this->Iv = $param['iv'];
$this->EncryptedData = $param['encryptedData'];
$data = $this->getSessionKey();
$this->Openid = $data['openid'];
$a = $this->decryptData( $this->EncryptedData,$this->Iv )需要解密信息才行unionid在$a里面