Authored by xiaowei

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

@@ -81,17 +81,21 @@ class BindData @@ -81,17 +81,21 @@ class BindData
81 * @param string $area 国别码 81 * @param string $area 国别码
82 * @param string $password 密码 82 * @param string $password 密码
83 */ 83 */
84 - public static function bindMobile($openId, $nickname, $sourceType, $mobile, $area, $password = '') 84 + public static function bindMobile($openId, $sourceType, $mobile, $area, $password = '', $nickname = '')
85 { 85 {
86 $param = Yohobuy::param(); 86 $param = Yohobuy::param();
87 87
88 $param['method'] = 'app.passport.bind'; 88 $param['method'] = 'app.passport.bind';
89 $param['mobile'] = $mobile; 89 $param['mobile'] = $mobile;
90 $param['open_id'] = $openId; 90 $param['open_id'] = $openId;
91 - $param['nickname'] = $nickname;  
92 $param['source_type'] = $sourceType; 91 $param['source_type'] = $sourceType;
93 $param['area'] = $area; 92 $param['area'] = $area;
94 - if (!empty($password)) { 93 + if (!empty($nickname))
  94 + {
  95 + $param['nickname'] = $nickname;
  96 + }
  97 + if (!empty($password))
  98 + {
95 $param['password'] = $password; 99 $param['password'] = $password;
96 } 100 }
97 $param['client_secret'] = Sign::getSign($param); 101 $param['client_secret'] = Sign::getSign($param);
@@ -99,7 +103,6 @@ class BindData @@ -99,7 +103,6 @@ class BindData
99 return Yohobuy::get(Yohobuy::API_URL, $param); 103 return Yohobuy::get(Yohobuy::API_URL, $param);
100 } 104 }
101 105
102 -  
103 /** 106 /**
104 * 换绑手机检验 107 * 换绑手机检验
105 * @param string $mobile 手机号 108 * @param string $mobile 手机号
@@ -116,7 +119,6 @@ class BindData @@ -116,7 +119,6 @@ class BindData
116 return Yohobuy::get(Yohobuy::API_URL, $param); 119 return Yohobuy::get(Yohobuy::API_URL, $param);
117 } 120 }
118 121
119 -  
120 /** 122 /**
121 * 换绑手机 123 * 换绑手机
122 * @param string $uid 用户Id 124 * @param string $uid 用户Id
@@ -138,5 +140,4 @@ class BindData @@ -138,5 +140,4 @@ class BindData
138 return Yohobuy::get(Yohobuy::API_URL, $param); 140 return Yohobuy::get(Yohobuy::API_URL, $param);
139 } 141 }
140 142
141 -  
142 } 143 }
@@ -225,14 +225,14 @@ class BindController extends AbstractAction @@ -225,14 +225,14 @@ class BindController extends AbstractAction
225 $openId = $this->post('openId'); 225 $openId = $this->post('openId');
226 $areaCode = $this->post('areaCode', '86'); 226 $areaCode = $this->post('areaCode', '86');
227 $sourceType = $this->post('sourceType'); 227 $sourceType = $this->post('sourceType');
228 - $nickname = $this->post('nickname');  
229 - $password = $this->post('password'); 228 +// $nickname = $this->post('nickname');//nickname不同步信息
  229 + $password = !empty($this->post('password'))?$this->post('password'):'';
230 230
231 if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) { 231 if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
232 break; 232 break;
233 } 233 }
234 234
235 - $res = BindData::bindMobile($openId, $nickname, $sourceType, $phoneNum, $areaCode, $password); 235 + $res = BindData::bindMobile($openId,$sourceType, $phoneNum, $areaCode, $password);
236 if (!isset($res['code'])) { 236 if (!isset($res['code'])) {
237 break; 237 break;
238 } 238 }