Authored by Rock Zhang

增加一些找回密码的判断逻辑

... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BackData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
/**
* 频道选择
... ... @@ -31,9 +32,21 @@ class BackController extends AbstractAction
*/
public function sendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '邮箱格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$email = $this->post('email', '');
// 判断邮箱是否有效
if(!Helpers::verifyEmail($email))
{
break;
}
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
... ... @@ -42,8 +55,10 @@ class BackController extends AbstractAction
$result['data'] = '/passport/back/success?email='.$email;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ... @@ -51,15 +66,28 @@ class BackController extends AbstractAction
*/
public function resendemailAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '重发邮件失败');
do
{
if(!$this->isAjax())
{
break;
}
$email = $this->get('email', '');
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
$return = BackData::sendCodeToEmail($email);
if(!empty($return))
{
$result = $return;
}
$this->echoJson($result);
}
while(false);
$this->echoJson($result);
}
public function successAction()
... ... @@ -133,20 +161,34 @@ class BackController extends AbstractAction
*/
public function sendcodeAction()
{
if($this->isAjax())
$result = array('code' => 400, 'message' => '手机号码格式不正确,请重新输入', 'data' => '');
do
{
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
break;
}
$phoneNum = $this->post('phoneNum', '');
$areaCode = $this->post('areaCode', 86);
if(!Helpers::verifyMobile($phoneNum))
{
break;
}
// 发送手机验证码
$result = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($result['code'] === 200)
$return = BackData::sendCodeToMobile($phoneNum, $areaCode);
if($return && $return['code'] === 200)
{
$result = $return;
$result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
}
$this->echoJson($result);
}
while (false);
$this->echoJson($result);
}
/**
... ...