...
|
...
|
@@ -25,22 +25,34 @@ class BackController extends WebAction { |
|
|
)
|
|
|
);
|
|
|
$this->_view->display ( 'index', $data );
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验验证码
|
|
|
*/
|
|
|
public function authcodeAction() {
|
|
|
$phoneNum = $this->post ('phoneNum', '');
|
|
|
$area = intval ($this->post( 'area', '86' ));
|
|
|
$verifyCode = $this->post ('verifyCode', '');
|
|
|
$data = array('code' => 400, 'message' =>'验证失败');
|
|
|
if ((Helpers::verifyEmail($phoneNum) || Helpers::verifyMobile($phoneNum))
|
|
|
&& PassportModel::verifyCode($verifyCode)) {
|
|
|
$data['code'] = 200;
|
|
|
$data['message'] = '验证成功';
|
|
|
}
|
|
|
echo $this->echoJson($data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验验证码
|
|
|
*/
|
|
|
public function authcodeAction()
|
|
|
{
|
|
|
$phoneNum = $this->post('phoneNum', '');
|
|
|
$area = intval($this->post('area', '86'));
|
|
|
$verifyCode = $this->post('verifyCode', '');
|
|
|
$data = array(
|
|
|
'code' => 200,
|
|
|
'message' => '验证成功'
|
|
|
);
|
|
|
if (PassportModel::verifyCode($verifyCode)) {
|
|
|
if (Helpers::verifyEmail($phoneNum)) {
|
|
|
if (empty(PassportModel::getUserInfoByEmail($phoneNum))) {
|
|
|
$data['message'] = '该账户不存在';
|
|
|
$data['code'] = 400;
|
|
|
}
|
|
|
} else if (Helpers::verifyMobile($phoneNum)) {
|
|
|
if (empty(PassportModel::getUserInfoByMobile($phoneNum, $area))) {
|
|
|
$data['message'] = '该账户不存在';
|
|
|
$data['code'] = 400;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
echo $this->echoJson($data);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|