Commit fa7847be authored by jianghaiming's avatar jianghaiming

update:Set

parent 4da4048d
......@@ -99,7 +99,7 @@ class UserService
$encryptedData = !empty($params['encryptedData']) ? urldecode($params['encryptedData']) : '';
$iv = !empty($params['iv']) ? urldecode($params['iv']) : '';
$appid = \Yaf\Registry::get('config')->wechat->appid;
if (!$encryptedData) {
throw new UserException(['cus' => 3]);
}
......@@ -112,14 +112,19 @@ class UserService
$sessionKey = !empty($userInfo['session_key']) ? $userInfo['session_key'] : '';
$openid = isset($userInfo['openid']) && $userInfo['openid'] ? $userInfo['openid'] : '';
if (empty($userInfo) || !$sessionKey || !$openid) {
throw new UserException(['cus' => 5]);
//throw new UserException(['cus' => 5]);
}
//解密
$decryptData = [];
$wXBizDataCrypt = new WxBizDataCrypt($appid, $sessionKey);
$errCode = $wXBizDataCrypt->decryptData($encryptedData, $iv, $decryptData);
if ($errCode) {
throw new UserException(['cus' => 6]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment