Commit 5b7ba7b4 authored by jianghaiming's avatar jianghaiming

update:修改格式化

parent bfaa103b
......@@ -92,10 +92,16 @@ class UserService
return $user;
}
/**
* 绑定手机号
* @param $params
* @return \Api\PhpUtils\Mysql\MysqlBase
* @throws UserException
* @throws \App\Exception\custom\CodeSpecialException
* @throws \App\Exception\custom\InterfaceException
*/
public static function bindPhone($params)
{
$openid = !empty($params['openid']) ? $params['openid'] : '';
$encryptedData = !empty($params['encryptedData']) ? $params['encryptedData'] : '';
$iv = !empty($params['iv']) ? $params['iv'] : '';
......@@ -116,19 +122,11 @@ class UserService
throw new UserException(['cus' => 5]);
}
//解密
$decryptData = [];
$wXBizDataCrypt = new WxBizDataCrypt($appid, $sessionKey);
$errCode = $wXBizDataCrypt->decryptData($encryptedData, $iv, $decryptData);
if ($errCode) {
throw new UserException(['cus' => 6]);
}
......@@ -139,7 +137,6 @@ class UserService
}
$phoneNumber = strval($decryptData['phoneNumber']);
//判断是否已
$user = UserWechatBind::getRecord(['phone' => $phoneNumber]);
if (!empty($user) && $openid != $user['openid']) {
......@@ -164,8 +161,6 @@ class UserService
throw new UserException(['cus' => 8]);
}
CommonService::isNewUser($params);
$isNewUser = CommonService::isNewUser(['openid' => $openid]);
if (!empty($isNewUser) && $isNewUser['is_new_user'] == 1) {
$userInfo['is_pop_up'] = 1;
......
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