Authored by 徐祁xuqi

Merge remote-tracking branch 'origin/hotfix/register'

... ... @@ -155,9 +155,10 @@ class RegData
* @param string $area 地区号 如"86"
* @param string $mobile 手机号
* @param string $password 登录密码
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
* @return array
*/
public static function regMobile($area, $mobile, $password)
public static function regMobile($area, $mobile, $password, $shoppingKey = '')
{
$clientType = 'web';
$param = Yohobuy::param();
... ... @@ -166,9 +167,12 @@ class RegData
$param['profile'] = $mobile;
$param['password'] = $password;
$param['client_type'] = $clientType;
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['private_key'] = Yohobuy::$privateKeyList[$clientType];
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -319,9 +319,9 @@ class RegisterController extends WebAction
$data['message'] = '验证码错误';
break;
}
$shoppingKey = Helpers::getShoppingKeyByCookie();
/* 手机注册: 调用注册接口,ip限制计数 */
$data = RegData::regMobile($area, $mobile, $password);
$data = RegData::regMobile($area, $mobile, $password, $shoppingKey);
Cache::set($ipKey, $ipTimes + 1, 3600);
if (!isset($data['code']) || $data['code'] != 200) {
break;
... ...