...
|
...
|
@@ -113,7 +113,7 @@ class AutouserinfoController extends WebAction |
|
|
}
|
|
|
//未注册 未绑定
|
|
|
if ($res['code'] == 200) {
|
|
|
$next = Helpers::url('/thirdlogin/index', array(
|
|
|
$next = Helpers::url('/thirdlogin/noregist', array(
|
|
|
'openId' => $openId,
|
|
|
'sourceType' => $sourceType,
|
|
|
'area' => $area,
|
...
|
...
|
@@ -135,6 +135,9 @@ class AutouserinfoController extends WebAction |
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* 根据手机号获取用户相关信息
|
|
|
*/
|
|
|
public static function getUserInfo($area, $mobile)
|
|
|
{
|
|
|
$userInfo = UserData::getUserInfoByMobile($area, $mobile);
|
...
|
...
|
@@ -162,16 +165,16 @@ class AutouserinfoController extends WebAction |
|
|
break;
|
|
|
}
|
|
|
|
|
|
$phoneNum = trim($this->post('mobile'));
|
|
|
$areaCode = trim($this->post('area'));
|
|
|
$mobile = trim($this->post('mobile'));
|
|
|
$area = trim($this->post('area'));
|
|
|
//校验手机号格式
|
|
|
if (!is_numeric($phoneNum) || !is_numeric($areaCode)) {
|
|
|
if (!is_numeric($mobile) || !is_numeric($area)) {
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '手机号码格式不正确';
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$data = BindData::sendBindMsg($areaCode, $phoneNum);
|
|
|
$data = BindData::sendBindMsg($area, $mobile);
|
|
|
if (!isset($data['code'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -194,17 +197,17 @@ class AutouserinfoController extends WebAction |
|
|
break;
|
|
|
}
|
|
|
|
|
|
$phoneNum = trim($this->post('mobile'));
|
|
|
$areaCode = trim($this->post('area'));
|
|
|
$mobile = trim($this->post('mobile'));
|
|
|
$area= trim($this->post('area'));
|
|
|
$code = trim($this->post('code')); //短信验证码
|
|
|
//校验手机号格式
|
|
|
if (!is_numeric($phoneNum) || !is_numeric($areaCode)) {
|
|
|
if (!is_numeric($mobile) || !is_numeric($area)) {
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '手机号码格式不正确';
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$data = BindData::checkBindCode($areaCode, $phoneNum, $code);
|
|
|
$data = BindData::checkBindCode($area, $mobile, $code);
|
|
|
if (!isset($data['code'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -227,8 +230,8 @@ class AutouserinfoController extends WebAction |
|
|
break;
|
|
|
}
|
|
|
|
|
|
$phoneNum = trim($this->post('mobile'));
|
|
|
$areaCode = trim($this->post('area', '86'));
|
|
|
$mobile = trim($this->post('mobile'));
|
|
|
$area = trim($this->post('area', '86'));
|
|
|
$openId = trim($this->post('openId'));
|
|
|
$sourceType = trim($this->post('sourceType'));
|
|
|
$code = trim($this->post('code')); //短信验证码
|
...
|
...
|
@@ -236,20 +239,20 @@ class AutouserinfoController extends WebAction |
|
|
$password = empty($password) ? '' : $password;
|
|
|
|
|
|
//校验手机号格式
|
|
|
if (!is_numeric($phoneNum) || !is_numeric($areaCode)) {
|
|
|
if (!is_numeric($mobile) || !is_numeric($area)) {
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '手机号码格式不正确';
|
|
|
break;
|
|
|
}
|
|
|
//校验手机验证码
|
|
|
$bindMsgFlag = BindData::checkBindCode($areaCode, $phoneNum, $code);
|
|
|
$bindMsgFlag = BindData::checkBindCode($area, $mobile, $code);
|
|
|
if (isset($bindMsgFlag['code']) && $bindMsgFlag['code'] != 200) {
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '短信验证码不正确';
|
|
|
break;
|
|
|
}
|
|
|
//绑定手机号
|
|
|
$res = BindData::bindMobile($openId, $sourceType, $phoneNum, $areaCode, $password);
|
|
|
$res = BindData::bindMobile($openId, $sourceType, $mobile, $area, $password);
|
|
|
if (!isset($res['code'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
|