Authored by hf

code review by hf: do final sale huodong

... ... @@ -119,8 +119,7 @@ class BindController extends AbstractAction
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
$nickname = $this->post('nickname');
if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType) {
break;
}
... ... @@ -132,12 +131,12 @@ class BindController extends AbstractAction
if ($res['code'] == 200) {
$next = Helpers::url('/passport/bind/code', array(
'isReg' => $res['data']['is_register'],
'openId' => $openId,
'sourceType' => $sourceType,
'areaCode' => $areaCode,
'phoneNum' => $phoneNum,
'nickname' => $nickname,
'isReg' => $res['data']['is_register'],
'openId' => $openId,
'sourceType' => $sourceType,
'areaCode' => $areaCode,
'phoneNum' => $phoneNum,
'nickname' => $nickname,
));
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next));
} else {
... ... @@ -225,7 +224,8 @@ class BindController extends AbstractAction
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
// $nickname = $this->post('nickname');//nickname不同步信息
$password = !empty($this->post('password')) ? $this->post('password') : '';
$password = $this->post('password');
$password = !empty($password) ? $password : '';
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
break;
... ... @@ -246,8 +246,9 @@ class BindController extends AbstractAction
if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) {
$token = Helpers::makeToken($res['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $res['data']['uid']);
$this->setCookie('_TOKEN', $token);
$refer = Helpers::syncUserSession($res['data']['uid'], $refer);
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer));
} else {
... ...