wx.getUserInfo 获取的加密数据解密 乱码
解密代码用的官方 稍微修改了下
if (strlen($this->sessionKey) != 24) {
//return ErrorCode::$IllegalAesKey;
return "";
}
$aesKey = base64_decode($this->sessionKey);
if (strlen($iv) != 24) {
//return ErrorCode::$IllegalIv;
return "";
}
$aesIV=base64_decode($iv);
$aesCipher=base64_decode($encryptedData);
$result = openssl_decrypt( aesKey, 1, $aesIV);
return $result;
解密结果就是

微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
本文网址:http://www.91bianli.com/kaifazhinan/66452.html