Authored by xiaowei

第三方登录修改

... ... @@ -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;
}
... ...
... ... @@ -3,6 +3,7 @@
use Action\WebAction;
use Passport\PassportModel;
use LibModels\Wap\Passport\RegData;
use WebPlugin\Helpers;
class ThirdloginController extends WebAction
{
... ... @@ -24,8 +25,8 @@ class ThirdloginController extends WebAction
'simpleHeader' => $simpleHeader,
'openId' => $openId,
'sourceType' => $sourceType,
'region' => RegData::getAreasData(),
'serviceUrl' => Helpers::url('/help', array('category_id' => 9))
'region' => RegData::getAreasData(),//区域
'serviceUrl' => Helpers::url('/help', array('category_id' => 9))//服务条款
);
$this->_view->display('index', $data);
... ...