From ba4219dc640139a4291f7d8016c28393ea359a0c Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Mon, 21 Oct 2019 11:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BF=98=E8=AE=B0=E5=AF=86?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/Controller/SsgController.class.php | 27 ++ Application/Mobile/View/Ssg/login.html | 230 +++++++++++++----- Public/Mobile/css/ssg/common.css | 2 +- Public/Mobile/images/ssg/home/hader.png | Bin 985987 -> 978832 bytes Public/Mobile/images/ssg/index/ad.png | Bin 669168 -> 664557 bytes Public/Mobile/images/ssg/login/forget.png | Bin 0 -> 1778 bytes 6 files changed, 198 insertions(+), 61 deletions(-) create mode 100644 Public/Mobile/images/ssg/login/forget.png 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..423f6959c 100644 --- a/Application/Mobile/View/Ssg/login.html +++ b/Application/Mobile/View/Ssg/login.html @@ -17,7 +17,7 @@ - -
@@ -155,20 +161,115 @@
- +
+ +
+
+ +
忘记密码
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ 获取验证码 +
+
+ + + +
+
+