diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index fcb1932c1..dcb4958bf 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -164,6 +164,33 @@ class SsgController extends BaseController { $this -> set_message(1, "success", "添加成功"); } + //忘记密码 + public function forgetPassword() + { + $user = $_POST; + if (empty($user)) { + $this -> set_message(1001, "fail", "基础信息不能为空"); + } + $this -> sms_verify($user['account'], $user['code']); + //更新密码 + $userApi = new MemberApi(); + $userInfo = M("user","tab_")->where("account = '".$user['account']."'")->find(); + if(empty($userInfo)){ + $this -> set_message(1003, "fail", "用户不存在"); + } + //更新用户 + $upres = $userApi->updatePassword($userInfo['id'], $user['password']); + if($upres){ + //自动登陆 + $user_id = $userApi->login($user['account'], $user['password'],1); + $this -> set_message(0, "success", "修改成功"); + + }else{ + + $this -> set_message(1005, "fail", "密码更新错误,请刷新后再次尝试"); + } + # code... + } //普通注册 public function userRegister() { diff --git a/Application/Mobile/View/Ssg/login.html b/Application/Mobile/View/Ssg/login.html index 69c967d27..520c734b3 100644 --- a/Application/Mobile/View/Ssg/login.html +++ b/Application/Mobile/View/Ssg/login.html @@ -17,7 +17,7 @@
- - - +