|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Passport\BackData;
|
|
|
/**
|
|
|
* 频道选择
|
|
|
*/
|
...
|
...
|
@@ -23,6 +25,22 @@ class BackController extends AbstractAction |
|
|
$this->_view->display('email', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送邮箱验证码
|
|
|
*/
|
|
|
public function emailcodeSendAction()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$email = $this->get('email', '');
|
|
|
|
|
|
// 发送邮箱验证码
|
|
|
$result = BackData::sendCodeToEmail($email);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function successAction()
|
|
|
{
|
|
|
$data = array(
|
...
|
...
|
@@ -38,24 +56,57 @@ class BackController extends AbstractAction |
|
|
$this->_view->display('email-success', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据邮箱修改密码
|
|
|
*
|
|
|
* @return array 根据邮箱修改密码的结果
|
|
|
*/
|
|
|
public function passwordByEmailAction()
|
|
|
{
|
|
|
// host是www.yohobuy.com ,只需要code,然后再输入新密码即可
|
|
|
$code = $this->get('code', '');
|
|
|
|
|
|
// 根据邮箱修改密码(接口待定)
|
|
|
// $result = BackData::validateMobileCode($mobile, $code, $area);
|
|
|
|
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
|
|
|
|
|
|
public function mobileAction()
|
|
|
{
|
|
|
// 获取地区信息
|
|
|
$areas = array();
|
|
|
$areaDatas = $data = BackData::getAreasData();
|
|
|
if($areaDatas['code'] == 200)
|
|
|
{
|
|
|
$areas = $areaDatas['data'];
|
|
|
}
|
|
|
// 处理地区信息
|
|
|
foreach ($areas as &$val) {
|
|
|
$val['areaCode'] = $val['area'];
|
|
|
if($val['area'] == 86)
|
|
|
{
|
|
|
$val['selected'] = true;
|
|
|
}
|
|
|
unset($val['area']);
|
|
|
}
|
|
|
/*// 排序
|
|
|
uasort($areas, function($a, $b) {
|
|
|
if($a['id'] === $b['id'])
|
|
|
{
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
return ($a['id'] < $b['id'] ? -1 : 1);
|
|
|
});*/
|
|
|
|
|
|
$data = array(
|
|
|
'backUrl' => 'm.yohobuy.com',
|
|
|
'headerText' => '找回密码',
|
|
|
'isPassportPage' => true,
|
|
|
'modulePath' => 'passport/back/mobile',
|
|
|
'countrys' => array(
|
|
|
array(
|
|
|
'areaCode' => '+86',
|
|
|
'selected' => true,
|
|
|
'name' => '中国'
|
|
|
),
|
|
|
array(
|
|
|
'areaCode' => '+864',
|
|
|
'name' => '中国香港'
|
|
|
)
|
|
|
),
|
|
|
'countrys' => $areas,
|
|
|
'countryCode' => '+86'
|
|
|
);
|
|
|
|
...
|
...
|
@@ -63,23 +114,67 @@ class BackController extends AbstractAction |
|
|
$this->_view->display('mobile', $data);
|
|
|
}
|
|
|
|
|
|
public function codeAction()
|
|
|
/**
|
|
|
* 发送手机验证码
|
|
|
*/
|
|
|
public function mobilecodeSendAction()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
|
|
|
// 发送手机验证码
|
|
|
$result = BackData::sendCodeToMobile($mobile, $area);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function mobilecodeAction()
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
|
|
|
$data = array(
|
|
|
'backUrl' => 'm.yohobuy.com',
|
|
|
'headerText' => '找回密码',
|
|
|
'isPassportPage' => true,
|
|
|
'modulePath' => 'passport/back/code',
|
|
|
'areaCode' => '+86',
|
|
|
'phoneNum' => '15895869035'
|
|
|
'phoneNum' => $mobile
|
|
|
);
|
|
|
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('mobile-code', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验手机验证码
|
|
|
*
|
|
|
* @return array 校验手机验证码的结果
|
|
|
*/
|
|
|
public function mobilecodeValidateAction()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$code = $this->get('code', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
|
|
|
// 校验手机验证码
|
|
|
$result = BackData::validateMobileCode($mobile, $code, $area);
|
|
|
|
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function passwordAction()
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$token = $this->get('token', '');
|
|
|
$area = $this->get('area', 86);
|
|
|
|
|
|
$data = array(
|
|
|
'backUrl' => 'm.yohobuy.com',
|
|
|
'headerText' => '找回密码',
|
...
|
...
|
@@ -99,4 +194,25 @@ class BackController extends AbstractAction |
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('new-password', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据手机验证码修改密码
|
|
|
*
|
|
|
* @return array 根据手机验证码修改密码的结果
|
|
|
*/
|
|
|
public function passwordByMobileAction()
|
|
|
{
|
|
|
if($this->isAjax())
|
|
|
{
|
|
|
$mobile = $this->get('mobile', '');
|
|
|
$token = $this->get('token', '');
|
|
|
$newpwd = $this->get('newpwd', 86);
|
|
|
$area = $this->get('area', 86);
|
|
|
|
|
|
// 根据手机验证码修改密码
|
|
|
$result = BackData::modifyPasswordByMobile($mobile, $token, $newpwd, $area);
|
|
|
|
|
|
$this->echoJson($data);
|
|
|
}
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|