[更新]修改微信小程序解析支持

This commit is contained in:
Anyon 2018-04-18 17:45:02 +08:00
parent bb07da202b
commit a81f4bcf15

View File

@ -16,6 +16,8 @@ namespace WeMini;
use WeChat\Contracts\BasicWeChat; use WeChat\Contracts\BasicWeChat;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'crypt' . DIRECTORY_SEPARATOR . 'wxBizDataCrypt.php';
/** /**
* 数据加密处理 * 数据加密处理
* Class Crypt * Class Crypt
@ -27,13 +29,12 @@ class Crypt extends BasicWeChat
/** /**
* 数据签名校验 * 数据签名校验
* @param string $iv * @param string $iv
* @param string $encryptedData
* @param string $sessionKey * @param string $sessionKey
* @param string $encryptedData
* @return bool * @return bool
*/ */
public function decode($iv, $encryptedData, $sessionKey) public function decode($iv, $sessionKey, $encryptedData)
{ {
require_once __DIR__ . DIRECTORY_SEPARATOR . 'wxBizDataCrypt.php';
$pc = new \WXBizDataCrypt($this->config->get('appid'), $sessionKey); $pc = new \WXBizDataCrypt($this->config->get('appid'), $sessionKey);
$errCode = $pc->decryptData($encryptedData, $iv, $data); $errCode = $pc->decryptData($encryptedData, $iv, $data);
if ($errCode == 0) { if ($errCode == 0) {