~~~
/**
* 找回密码_步骤
** 判断帐号类型
** 手机发送验证码||邮箱发送验证码
** 修改密码
**/
public function findpass()
{
$step = I('get.step');
if($step == 1 || $step == null || !$step){ //step1
if(IS_POST){
$account = I('post.account') ? trim(I('post.account')) : '';
if(!$account) $this->error('帐号不能为空!');
$M = M('member');
//验证帐号是否存在
$Account = $M->field('mtel,email')->where(" mtel = '$account' or email = '$account' ")->select();
if(!$Account) $this->error('账户未注册');
$this->assign('account',$account);
$type = 0; //账号类型:0空,1手机,-1邮箱
//分辨帐号类型
if(preg_match('/^1[3456789]\d{9}$/',$account)) $type = 1;
if(preg_match('/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/',$account)) $type = -1;
//跳转步骤二
$this->assign('type',$type);
$this->step = 2;
$this->display();
}else{ //!IS_POST
$this->step = 1;
$this->display();
}
}elseif($step == 2 ){ //step2
if(IS_POST){
$account = I('post.account') ? trim(I('post.account')) : '';
$code = I('post.code') ? trim(I('post.code')) : '';
if(!$code) $this->error('验证码不能为空!');
if(!$account) $this->error('帐号不能为空!');