forget.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  6. <title>{$title}-找回密码</title>
  7. <meta name="renderer" content="webkit">
  8. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  9. <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
  10. <link href="/static/hplus/css/bootstrap.min.css?v=3.3.7" rel="stylesheet" />
  11. <link href="/static/hplus/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" />
  12. <link href="/static/hplus/css/animate.css" rel="stylesheet" />
  13. <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet" />
  14. <link href="/static/admin/css/login.css" rel="stylesheet">
  15. <!--[if lt IE 9]>
  16. <meta http-equiv="refresh" content="0;ie.html" />
  17. <![endif]-->
  18. <script>
  19. if(window.top!==window.self){window.top.location=window.location};
  20. </script>
  21. <style>
  22. .verifyimg{
  23. width:46%;
  24. height: 40px;
  25. margin-bottom: 3px;
  26. border: 1px solid #ccc;
  27. cursor: pointer;
  28. }
  29. .login-title{
  30. font-size: 18px;
  31. color: #222;
  32. }
  33. .form-control{
  34. }
  35. .btn-block{
  36. margin-top: 10px;
  37. }
  38. .login-input-box{
  39. height: 55px !important;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div class="login-box">
  45. <div class="login-box-left">
  46. <div class="login-box-banner">
  47. <img src="/static/admin/img/tu.png" alt="">
  48. </div>
  49. <!-- <div class="l-title">-->
  50. <!-- <div class="l-title-a">欢迎使用</div>-->
  51. <!-- <div class="l-title-a">{$title}</div>-->
  52. <!-- </div>-->
  53. </div>
  54. <div class="login-box-right">
  55. <div class="from-data">
  56. <div class="form-right">
  57. <div class="logo-title">
  58. 找回密码
  59. </div>
  60. <form method="post" style="margin: 0 49px;" action="{:url('forget')}">
  61. <div class="login-input-box" style="display:flex !important;">
  62. <div class="login_input-box" style="width: 160px !important;">
  63. <input type="text" name="account" id="phone" class="form-control uname" placeholder="手机号" />
  64. </div>
  65. <div class="login_input-box" style="width: 140px !important;">
  66. <input type="text" readonly id="yzm" value="获取验证码" style="cursor: pointer" onclick="sendsms(this)" class="form-control uname" />
  67. </div>
  68. </div>
  69. <div class="login-input-box">
  70. <div class="login_input-box">
  71. <input type="text" name="code" class="form-control uname" placeholder="验证码" />
  72. </div>
  73. </div>
  74. <div class="login-input-box">
  75. <div class="login_input-box">
  76. <input type="password" name="password" class="form-control pword m-b" placeholder="新密码" />
  77. </div>
  78. </div>
  79. <button class="btn btn-info btn-block" >提 交</button>
  80. <h5 class="forget"><a href="{:url('login')}">去登陆</a></h5>
  81. </form>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="copyright-text">
  87. Copyright © 2023 {$title} 版权所有 <a target="_blank" href="https://beian.miit.gov.cn/#/Integrated/index">豫ICP备2023032306号</a>
  88. </div>
  89. <script src="/static/hplus/js/jquery.min.js?v=2.1.4"></script>
  90. <script src="/static/hplus/js/bootstrap.min.js?v=3.3.7"></script>
  91. <script src="/static/layer/layer.js"></script>
  92. <script>
  93. $(function(){
  94. //表单提交
  95. $(document)
  96. .ajaxStart(function(){
  97. $("button:submit").html('登 录 中...').attr("disabled", true);
  98. })
  99. .ajaxStop(function(){
  100. $("button:submit").html('登 录').attr("disabled", false);
  101. });
  102. $("form").submit(function(){
  103. var self = $(this);
  104. self.find(".check-tips").text('');
  105. $.post(self.attr("action"), self.serialize(), success, "json");
  106. return false;
  107. function success(data){
  108. if(data.code){
  109. window.location.href = data.url;
  110. } else {
  111. layer.msg(data.msg)
  112. //刷新验证码
  113. $(".reloadverify").click();
  114. }
  115. }
  116. });
  117. //刷新验证码
  118. var verifyimg = $(".verifyimg").attr("src");
  119. $(".reloadverify").click(function(){
  120. if( verifyimg.indexOf('?')>0){
  121. $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
  122. }else{
  123. $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
  124. }
  125. });
  126. });
  127. function sendsms(_self) {
  128. var flag = $(_self).attr('data-flag');
  129. if (flag == 1) {
  130. return false;
  131. }
  132. var mobile = $('#phone').val();
  133. if (mobile == '') {
  134. layer.msg('未填写手机号');
  135. return false;
  136. }
  137. $(_self).attr('data-flag', 1);
  138. $.ajax({
  139. url: '{:url("sms")}',
  140. type: "POST",
  141. data: {'mobile': mobile},
  142. success: function (res) {
  143. if (res.code == 1) {
  144. var time = 60;
  145. $('#yzm').val("(" + time + "s)重新获取");
  146. var timer = setInterval(function () {
  147. time--;
  148. if (time == 0) {
  149. $('#yzm').val("获取验证码");
  150. $(_self).attr('data-flag', 0);
  151. clearInterval(timer);
  152. } else {
  153. $('#yzm').val("(" + time + "s)重新获取");
  154. }
  155. }, 1000);
  156. } else {
  157. layer.msg(res.msg);
  158. $(_self).attr('data-flag', 0);
  159. $('#yzm').val("获取验证码");
  160. }
  161. },
  162. error: function (result) {
  163. layer.msg('请求失败');
  164. $(_self).attr('data-flag', 0);
  165. $('#yzm').val("获取验证码");
  166. }
  167. });
  168. }
  169. </script>
  170. </body>
  171. </html>