Authored by hf

code review by hf: do final sale huodong

@@ -119,8 +119,7 @@ class BindController extends AbstractAction @@ -119,8 +119,7 @@ class BindController extends AbstractAction
119 $areaCode = $this->post('areaCode', '86'); 119 $areaCode = $this->post('areaCode', '86');
120 $sourceType = $this->post('sourceType'); 120 $sourceType = $this->post('sourceType');
121 $nickname = $this->post('nickname'); 121 $nickname = $this->post('nickname');
122 -  
123 - 122 +
124 if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType) { 123 if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType) {
125 break; 124 break;
126 } 125 }
@@ -132,12 +131,12 @@ class BindController extends AbstractAction @@ -132,12 +131,12 @@ class BindController extends AbstractAction
132 131
133 if ($res['code'] == 200) { 132 if ($res['code'] == 200) {
134 $next = Helpers::url('/passport/bind/code', array( 133 $next = Helpers::url('/passport/bind/code', array(
135 - 'isReg' => $res['data']['is_register'],  
136 - 'openId' => $openId,  
137 - 'sourceType' => $sourceType,  
138 - 'areaCode' => $areaCode,  
139 - 'phoneNum' => $phoneNum,  
140 - 'nickname' => $nickname, 134 + 'isReg' => $res['data']['is_register'],
  135 + 'openId' => $openId,
  136 + 'sourceType' => $sourceType,
  137 + 'areaCode' => $areaCode,
  138 + 'phoneNum' => $phoneNum,
  139 + 'nickname' => $nickname,
141 )); 140 ));
142 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next)); 141 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next));
143 } else { 142 } else {
@@ -225,7 +224,8 @@ class BindController extends AbstractAction @@ -225,7 +224,8 @@ class BindController extends AbstractAction
225 $areaCode = $this->post('areaCode', '86'); 224 $areaCode = $this->post('areaCode', '86');
226 $sourceType = $this->post('sourceType'); 225 $sourceType = $this->post('sourceType');
227 // $nickname = $this->post('nickname');//nickname不同步信息 226 // $nickname = $this->post('nickname');//nickname不同步信息
228 - $password = !empty($this->post('password')) ? $this->post('password') : ''; 227 + $password = $this->post('password');
  228 + $password = !empty($password) ? $password : '';
229 229
230 if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) { 230 if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
231 break; 231 break;
@@ -246,8 +246,9 @@ class BindController extends AbstractAction @@ -246,8 +246,9 @@ class BindController extends AbstractAction
246 246
247 if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) { 247 if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) {
248 $token = Helpers::makeToken($res['data']['uid']); 248 $token = Helpers::makeToken($res['data']['uid']);
249 - $this->setCookie('_TOKEN', $token);  
250 $this->setSession('_TOKEN', $token); 249 $this->setSession('_TOKEN', $token);
  250 + $this->setSession('_LOGIN_UID', $res['data']['uid']);
  251 + $this->setCookie('_TOKEN', $token);
251 $refer = Helpers::syncUserSession($res['data']['uid'], $refer); 252 $refer = Helpers::syncUserSession($res['data']['uid'], $refer);
252 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer)); 253 $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer));
253 } else { 254 } else {