Authored by xiaowei

第三方登录修改

@@ -113,7 +113,7 @@ class AutouserinfoController extends WebAction @@ -113,7 +113,7 @@ class AutouserinfoController extends WebAction
113 } 113 }
114 //未注册 未绑定 114 //未注册 未绑定
115 if ($res['code'] == 200) { 115 if ($res['code'] == 200) {
116 - $next = Helpers::url('/thirdlogin/index', array( 116 + $next = Helpers::url('/thirdlogin/noregist', array(
117 'openId' => $openId, 117 'openId' => $openId,
118 'sourceType' => $sourceType, 118 'sourceType' => $sourceType,
119 'area' => $area, 119 'area' => $area,
@@ -135,6 +135,9 @@ class AutouserinfoController extends WebAction @@ -135,6 +135,9 @@ class AutouserinfoController extends WebAction
135 $this->echoJson($data); 135 $this->echoJson($data);
136 } 136 }
137 137
  138 + /*
  139 + * 根据手机号获取用户相关信息
  140 + */
138 public static function getUserInfo($area, $mobile) 141 public static function getUserInfo($area, $mobile)
139 { 142 {
140 $userInfo = UserData::getUserInfoByMobile($area, $mobile); 143 $userInfo = UserData::getUserInfoByMobile($area, $mobile);
@@ -162,16 +165,16 @@ class AutouserinfoController extends WebAction @@ -162,16 +165,16 @@ class AutouserinfoController extends WebAction
162 break; 165 break;
163 } 166 }
164 167
165 - $phoneNum = trim($this->post('mobile'));  
166 - $areaCode = trim($this->post('area')); 168 + $mobile = trim($this->post('mobile'));
  169 + $area = trim($this->post('area'));
167 //校验手机号格式 170 //校验手机号格式
168 - if (!is_numeric($phoneNum) || !is_numeric($areaCode)) { 171 + if (!is_numeric($mobile) || !is_numeric($area)) {
169 $data['code'] = 400; 172 $data['code'] = 400;
170 $data['message'] = '手机号码格式不正确'; 173 $data['message'] = '手机号码格式不正确';
171 break; 174 break;
172 } 175 }
173 176
174 - $data = BindData::sendBindMsg($areaCode, $phoneNum); 177 + $data = BindData::sendBindMsg($area, $mobile);
175 if (!isset($data['code'])) { 178 if (!isset($data['code'])) {
176 break; 179 break;
177 } 180 }
@@ -194,17 +197,17 @@ class AutouserinfoController extends WebAction @@ -194,17 +197,17 @@ class AutouserinfoController extends WebAction
194 break; 197 break;
195 } 198 }
196 199
197 - $phoneNum = trim($this->post('mobile'));  
198 - $areaCode = trim($this->post('area')); 200 + $mobile = trim($this->post('mobile'));
  201 + $area= trim($this->post('area'));
199 $code = trim($this->post('code')); //短信验证码 202 $code = trim($this->post('code')); //短信验证码
200 //校验手机号格式 203 //校验手机号格式
201 - if (!is_numeric($phoneNum) || !is_numeric($areaCode)) { 204 + if (!is_numeric($mobile) || !is_numeric($area)) {
202 $data['code'] = 400; 205 $data['code'] = 400;
203 $data['message'] = '手机号码格式不正确'; 206 $data['message'] = '手机号码格式不正确';
204 break; 207 break;
205 } 208 }
206 209
207 - $data = BindData::checkBindCode($areaCode, $phoneNum, $code); 210 + $data = BindData::checkBindCode($area, $mobile, $code);
208 if (!isset($data['code'])) { 211 if (!isset($data['code'])) {
209 break; 212 break;
210 } 213 }
@@ -227,8 +230,8 @@ class AutouserinfoController extends WebAction @@ -227,8 +230,8 @@ class AutouserinfoController extends WebAction
227 break; 230 break;
228 } 231 }
229 232
230 - $phoneNum = trim($this->post('mobile'));  
231 - $areaCode = trim($this->post('area', '86')); 233 + $mobile = trim($this->post('mobile'));
  234 + $area = trim($this->post('area', '86'));
232 $openId = trim($this->post('openId')); 235 $openId = trim($this->post('openId'));
233 $sourceType = trim($this->post('sourceType')); 236 $sourceType = trim($this->post('sourceType'));
234 $code = trim($this->post('code')); //短信验证码 237 $code = trim($this->post('code')); //短信验证码
@@ -236,20 +239,20 @@ class AutouserinfoController extends WebAction @@ -236,20 +239,20 @@ class AutouserinfoController extends WebAction
236 $password = empty($password) ? '' : $password; 239 $password = empty($password) ? '' : $password;
237 240
238 //校验手机号格式 241 //校验手机号格式
239 - if (!is_numeric($phoneNum) || !is_numeric($areaCode)) { 242 + if (!is_numeric($mobile) || !is_numeric($area)) {
240 $data['code'] = 400; 243 $data['code'] = 400;
241 $data['message'] = '手机号码格式不正确'; 244 $data['message'] = '手机号码格式不正确';
242 break; 245 break;
243 } 246 }
244 //校验手机验证码 247 //校验手机验证码
245 - $bindMsgFlag = BindData::checkBindCode($areaCode, $phoneNum, $code); 248 + $bindMsgFlag = BindData::checkBindCode($area, $mobile, $code);
246 if (isset($bindMsgFlag['code']) && $bindMsgFlag['code'] != 200) { 249 if (isset($bindMsgFlag['code']) && $bindMsgFlag['code'] != 200) {
247 $data['code'] = 400; 250 $data['code'] = 400;
248 $data['message'] = '短信验证码不正确'; 251 $data['message'] = '短信验证码不正确';
249 break; 252 break;
250 } 253 }
251 //绑定手机号 254 //绑定手机号
252 - $res = BindData::bindMobile($openId, $sourceType, $phoneNum, $areaCode, $password); 255 + $res = BindData::bindMobile($openId, $sourceType, $mobile, $area, $password);
253 if (!isset($res['code'])) { 256 if (!isset($res['code'])) {
254 break; 257 break;
255 } 258 }
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 use Action\WebAction; 3 use Action\WebAction;
4 use Passport\PassportModel; 4 use Passport\PassportModel;
5 use LibModels\Wap\Passport\RegData; 5 use LibModels\Wap\Passport\RegData;
  6 +use WebPlugin\Helpers;
6 7
7 class ThirdloginController extends WebAction 8 class ThirdloginController extends WebAction
8 { 9 {
@@ -24,8 +25,8 @@ class ThirdloginController extends WebAction @@ -24,8 +25,8 @@ class ThirdloginController extends WebAction
24 'simpleHeader' => $simpleHeader, 25 'simpleHeader' => $simpleHeader,
25 'openId' => $openId, 26 'openId' => $openId,
26 'sourceType' => $sourceType, 27 'sourceType' => $sourceType,
27 - 'region' => RegData::getAreasData(),  
28 - 'serviceUrl' => Helpers::url('/help', array('category_id' => 9)) 28 + 'region' => RegData::getAreasData(),//区域
  29 + 'serviceUrl' => Helpers::url('/help', array('category_id' => 9))//服务条款
29 ); 30 );
30 31
31 $this->_view->display('index', $data); 32 $this->_view->display('index', $data);