...
|
...
|
@@ -108,7 +108,7 @@ class BackController extends AbstractAction |
|
|
}
|
|
|
// 处理地区信息
|
|
|
foreach ($areas as &$val) {
|
|
|
$val['areaCode'] = $val['area'];
|
|
|
$val['areaCode'] = '+'.$val['area'];
|
|
|
if($val['area'] === '86')
|
|
|
{
|
|
|
$val['selected'] = true;
|
...
|
...
|
@@ -145,28 +145,36 @@ class BackController extends AbstractAction |
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->post('mobile', '');
|
|
|
$area = $this->post('area', 86);
|
|
|
$phoneNum = $this->post('phoneNum', '');
|
|
|
$areaCode = $this->post('areaCode', 86);
|
|
|
|
|
|
// 发送手机验证码
|
|
|
$result = BackData::sendCodeToMobile($mobile, $area);
|
|
|
$result = BackData::sendCodeToMobile($phoneNum, $areaCode);
|
|
|
if($result['code'] === 200)
|
|
|
{
|
|
|
$result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验验证码页面
|
|
|
*/
|
|
|
public function mobilecodeAction()
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
$areacode = '+'.$area;
|
|
|
$phoneNum = $this->get('phoneNum', '');
|
|
|
$areaCode = $this->get('areaCode', 86);
|
|
|
$areaCode = '+'.$areaCode;
|
|
|
|
|
|
$data = array(
|
|
|
'backUrl' => '/passport/back/mobile',
|
|
|
'headerText' => '找回密码',
|
|
|
'isPassportPage' => true,
|
|
|
'areaCode' => $areacode,
|
|
|
'phoneNum' => $mobile
|
|
|
'backCode' => true,
|
|
|
'areaCode' => $areaCode,
|
|
|
'phoneNum' => $phoneNum
|
|
|
);
|
|
|
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
...
|
...
|
@@ -182,12 +190,16 @@ class BackController extends AbstractAction |
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->post('mobile', '');
|
|
|
$phoneNum = $this->post('phoneNum', '');
|
|
|
$code = $this->post('code', '');
|
|
|
$area = $this->post('area', 86);
|
|
|
$areaCode = $this->post('areaCode', 86);
|
|
|
|
|
|
// 校验手机验证码
|
|
|
$result = BackData::validateMobileCode($mobile, $code, $area);
|
|
|
$result = BackData::validateMobileCode($phoneNum, $code, $areaCode);
|
|
|
if($result['code'] === 200)
|
|
|
{
|
|
|
$result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['token'].'&areaCode='.$areaCode;
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -195,10 +207,10 @@ class BackController extends AbstractAction |
|
|
|
|
|
public function passwordAction()
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$phoneNum = $this->get('phoneNum', '');
|
|
|
// 手机验证令牌
|
|
|
$token = $this->get('token', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
$areaCode = $this->get('areaCode', 86);
|
|
|
|
|
|
// 邮箱验证码
|
|
|
$code = $this->get('code', '');
|
...
|
...
|
@@ -208,9 +220,9 @@ class BackController extends AbstractAction |
|
|
'headerText' => '找回密码',
|
|
|
'isPassportPage' => true,
|
|
|
'backNewPwd' => true,
|
|
|
'mobile' => $mobile,
|
|
|
'phoneNum' => $phoneNum,
|
|
|
'token' => $token,
|
|
|
'areaCode' => $area,
|
|
|
'areaCode' => $areaCode,
|
|
|
'code' => $code
|
|
|
);
|
|
|
|
...
|
...
|
@@ -227,13 +239,17 @@ class BackController extends AbstractAction |
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->post('mobile', '');
|
|
|
$phoneNum = $this->post('phoneNum', '');
|
|
|
$token = $this->post('token', '');
|
|
|
$newpwd = $this->post('password', '');
|
|
|
$area = $this->post('area', 86);
|
|
|
$areaCode = $this->post('areaCode', 86);
|
|
|
|
|
|
// 根据手机验证码修改密码
|
|
|
$result = BackData::modifyPasswordByMobile($mobile, $token, $newpwd, $area);
|
|
|
$result = BackData::modifyPasswordByMobile($phoneNum, $token, $newpwd, $areaCode);
|
|
|
if($result['code'] === 200)
|
|
|
{
|
|
|
$result['data'] = '/';
|
|
|
}
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
|