如題,急急急,跪求幫助!
appid:wx4f2f76fbdeec9459
未登錄過(guò)公眾號(hào)之類的用戶直接登錄小程序,已經(jīng)進(jìn)行授權(quán),還是獲取不到unionid,求解
網(wǎng)友回復(fù):
unionid需要第三方平臺(tái)介入才能獲取到:https://open.weixin.qq.com/
已經(jīng)第三方平臺(tái)介入了,之前是做公眾號(hào)的,原先公眾號(hào)的用戶進(jìn)入小程序全都沒(méi)有問(wèn)題,正常獲取,新用戶獲取不到
$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里面