...
|
...
|
@@ -3,7 +3,7 @@ use Action\WebAction; |
|
|
use LibModels\Web\Passport\RegData;
|
|
|
use Passport\PassportModel;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Passport\BackData;
|
|
|
use LibModels\Web\Passport\BackData;
|
|
|
use Plugin\AuthCode;
|
|
|
class BackController extends WebAction {
|
|
|
|
...
|
...
|
@@ -43,14 +43,14 @@ class BackController extends WebAction { |
|
|
if (Helpers::verifyEmail($phoneNum)) {
|
|
|
$ret = PassportModel::getUserInfoByEmail($phoneNum);
|
|
|
if (empty($ret)) {
|
|
|
$data['message'] = '该账户不存在';
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '该邮件账户不存在';
|
|
|
$data['code'] = 401;
|
|
|
}
|
|
|
} else if (Helpers::verifyMobile($phoneNum)) {
|
|
|
$ret = PassportModel::getUserInfoByMobile($area, $phoneNum);
|
|
|
if (empty($ret)) {
|
|
|
$data['message'] = '该账户不存在';
|
|
|
$data['code'] = 400;
|
|
|
$data['message'] = '该手机号不存在';
|
|
|
$data['code'] = 402;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
...
|
...
|
@@ -135,7 +135,22 @@ class BackController extends WebAction { |
|
|
{
|
|
|
$code = $this->get('code');
|
|
|
$info = $this->checkCode($code);
|
|
|
if (empty ( $info )) {
|
|
|
$verifyState = false;//验证状态
|
|
|
$ret = array();
|
|
|
if (!empty ( $info )) {
|
|
|
$verifyState = true;
|
|
|
if(isset($info['uid'])) { //老版修改邮箱密码
|
|
|
$verifyState = false;//重新找回密码
|
|
|
}
|
|
|
} else {
|
|
|
$ret = BackData::checkEmailCode($code);
|
|
|
if(isset($ret['data']) && $ret['code'] == 200) {
|
|
|
$verifyState = true;
|
|
|
}
|
|
|
}
|
|
|
//验证失败
|
|
|
if(!$verifyState)
|
|
|
{
|
|
|
$this->redirect ('index');
|
|
|
}
|
|
|
$banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
|
...
|
...
|
@@ -160,23 +175,29 @@ class BackController extends WebAction { |
|
|
$code = $this->post('code');
|
|
|
$password = $this->post('pwd');
|
|
|
$info = $this->checkCode($code);
|
|
|
if (Helpers::verifyPassword ($password) && ! empty ($info)) {
|
|
|
// 修改密码
|
|
|
if (isset ( $info ['mobile'] )) { // 手机号修改密码
|
|
|
$mobile = $info ['mobile'];
|
|
|
$token = $info ['token'];
|
|
|
$area = $info ['area'];
|
|
|
$data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
|
|
|
if (Helpers::verifyPassword ($password)) {
|
|
|
if(!empty($info)) { //手机号找回
|
|
|
// 修改密码
|
|
|
if (isset ( $info ['mobile'] )) { // 手机号修改密码
|
|
|
$mobile = $info ['mobile'];
|
|
|
$token = $info ['token'];
|
|
|
$area = $info ['area'];
|
|
|
$data = BackData::modifyPasswordByMobile($mobile, $token, $password, $area);
|
|
|
if ($data ['code'] == 200) {
|
|
|
$this->redirect ( 'resetSuccess' );
|
|
|
}
|
|
|
} else if (isset ($info ['uid'])) { //其他方式修改密码,跳到找回密码首页
|
|
|
$this->redirect ( '/index' );
|
|
|
}
|
|
|
} else { //新版邮箱修改接口
|
|
|
$data = BackData::modifyPasswordByEmailCode($code, $password);
|
|
|
if ($data ['code'] == 200) {
|
|
|
$this->redirect ( 'resetSuccess' );
|
|
|
}
|
|
|
} else if (isset ($info ['uid'])) { // 其他方式修改密码
|
|
|
$uid = $info ['uid'];
|
|
|
$this->redirect ( 'resetSuccess' );
|
|
|
}
|
|
|
}
|
|
|
// 跳转错误页面
|
|
|
$this->redirect('/error/index');
|
|
|
$this->redirect('/index');
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|