Authored by xiaowei

YW-1822 第三方登录绑定手机号不同步nickname

... ... @@ -81,17 +81,21 @@ class BindData
* @param string $area 国别码
* @param string $password 密码
*/
public static function bindMobile($openId, $nickname, $sourceType, $mobile, $area, $password = '')
public static function bindMobile($openId, $sourceType, $mobile, $area, $password = '', $nickname = '')
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.bind';
$param['mobile'] = $mobile;
$param['open_id'] = $openId;
$param['nickname'] = $nickname;
$param['source_type'] = $sourceType;
$param['area'] = $area;
if (!empty($password)) {
if (!empty($nickname))
{
$param['nickname'] = $nickname;
}
if (!empty($password))
{
$param['password'] = $password;
}
$param['client_secret'] = Sign::getSign($param);
... ... @@ -99,7 +103,6 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 换绑手机检验
* @param string $mobile 手机号
... ... @@ -116,7 +119,6 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 换绑手机
* @param string $uid 用户Id
... ... @@ -138,5 +140,4 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -225,14 +225,14 @@ class BindController extends AbstractAction
$openId = $this->post('openId');
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
$nickname = $this->post('nickname');
$password = $this->post('password');
// $nickname = $this->post('nickname');//nickname不同步信息
$password = !empty($this->post('password'))?$this->post('password'):'';
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
break;
}
$res = BindData::bindMobile($openId, $nickname, $sourceType, $phoneNum, $areaCode, $password);
$res = BindData::bindMobile($openId,$sourceType, $phoneNum, $areaCode, $password);
if (!isset($res['code'])) {
break;
}
... ...