diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index d0396d12d..24d491b82 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -662,6 +662,8 @@ class UserController extends BaseController if (IS_POST) { $new_pwd = $_REQUEST['new_pwd']; $u_uid['phone'] = $_REQUEST['phone']; + //验证短信验证码 + $this->checksafecode($u_uid['phone'], $_REQUEST['code'], false); $result = M('user', 'tab_')->where($u_uid)->setField('password', think_ucenter_md5($new_pwd, UC_AUTH_KEY)); if ($result != false) { $this->success("修改成功", U('User/login')); diff --git a/Application/Mobile/View/User/forget.html b/Application/Mobile/View/User/forget.html index e03b70ea3..bc6116c9c 100644 --- a/Application/Mobile/View/User/forget.html +++ b/Application/Mobile/View/User/forget.html @@ -1,48 +1,47 @@ - - - + -
+
-
找回密码 +
忘记密码
-
- -
-
- -
手机号
+
+ - -
-
- -
验证码
- + + + + +
+
通过手机号找回密码只适用于手机号注册的账号
+
用户名注册的账号可联系客服
-
获取验证码
-
-
下一步
-
-

- 通过手机号找回密码只适用于手机号注册的账号
用户名注册的账号可 - 联系客服 -

-
+
@@ -90,22 +89,44 @@ $(".submit").click(function(){ var mobile = $.trim($("#mobile").val()); var code = $.trim($("#code").val()); + var new_pwd = $.trim($("#new_pwd").val()); + var new_pwd_confirm = $.trim($("#new_pwd_confirm").val()); if(mobile.length == 0){ pmsg.msg('请输入手机号码'); return false; } + if(new_pwd.length == 0){ + pmsg.msg('请输入密码'); + return false; + } + if(new_pwd_confirm.length == 0){ + pmsg.msg('请输入确认密码'); + return false; + } if(code.length == 0){ pmsg.msg('请输入验证码'); return false; } + if(new_pwd.length < 6 || new_pwd.length > 12){ + pmsg.msg('密码长度6-12个字符'); + return false; + } + if(new_pwd != new_pwd_confirm){ + pmsg.msg('两次密码输入不一致'); + return false; + } $.ajax({ - url:"{:U('forget')}", + url:"{:U('forget1')}", type:"POST", dataType:"json", - data:{phone:$.trim($('#mobile').val()),code:$("#code").val()}, + data:{ + phone:$.trim($('#mobile').val()), + code:$("#code").val(), + new_pwd:new_pwd + }, success:function(result){ if(result.status == 1){ - pmsg.msg("验证成功"); + pmsg.msg("修改成功"); setTimeout(function () { window.location.href = result.url; }, 2000);