基础
模板:user/forget.html
提交接口: /login/forget
提交参数:
email: 绑定的邮箱
vercode: 验证码,生成规则:
{fun U('Common/vercode',['code_name'=>'forget_code'])}
忘记密码需要配置邮箱,否则无法发送邮件重置密码! 配置邮件
<form method="POST" onsubmit="return checklogin()" class="user-form"> <div class="form-control"> <label for="email">绑定邮箱</label> <input class="form-control item" type="email" name="email" id="email"> </div> <div class="form-control"> <label for="yzm">验证码</label> <input placeholder="请输入图形验证码" style="" type="text" name="vercode" id="vercode"><img style="width:150px;" src="{fun U('Common/vercode',['code_name'=>'forget_code'])}" onclick="this.src=this.src+'?'+Math.random()"> </div> <div class="form-control"> <label for="submit"></label> <input type="submit" name="submit" value="确定"> </div> </form> function checklogin(){ if($.trim($("#email").val())==''){ alert('邮箱不能为空~'); return false; } if($.trim($("#vercode").val())==''){ alert('图形验证码不能为空~'); return false; } return true; }