resetPassword.zml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ${Styles.src(zhiqim.css)}
  2. ${Scripts.src(zhiqim.js)}
  3. <link rel="stylesheet" type="text/css" href="zinc/css/base.css">
  4. <script src="zinc/js/jquery-1.11.1.min.js"></script>
  5. <script>
  6. //重置密码
  7. function resetPass()
  8. {
  9. var operatorMobile = Z("#operatorMobile").val();
  10. if (Z.V.isEmptyBlank(operatorMobile))
  11. {
  12. Z.failure("手机号不能为空!");
  13. Z("#operatorMobile").focus();
  14. return;
  15. }
  16. var smsCode = Z("#smsCode").val();
  17. if (Z.V.isEmptyBlank(smsCode))
  18. {
  19. Z.failure("验证码不能为空!");
  20. return;
  21. }
  22. var operatorPass = Z("#operatorPass").val();
  23. if (Z.V.isEmptyBlank(operatorPass))
  24. {
  25. Z.failure("密码不能为空!");
  26. Z("#operatorPass").focus();
  27. return;
  28. }
  29. var operatorNewPass = Z("#operatorNewPass").val();
  30. if (operatorPass != operatorNewPass)
  31. {
  32. Z.failure("两次确认密码不一样!");
  33. return;
  34. }
  35. var ajax = new Z.Ajax();
  36. ajax.setClassName("ZmrLoginPresenter");
  37. ajax.setMethodName("resetPassword");
  38. ajax.addParam("operatorMobile", operatorMobile);
  39. ajax.addParam("operatorPass", operatorPass);
  40. ajax.addParam("operatorNewPass", operatorNewPass);
  41. ajax.addParam("smsCode", smsCode);
  42. ajax.setFailureAlert();
  43. ajax.setSuccess(function(responseText){
  44. Z.success(responseText,function(){window.location.href= window.location.href= "/";});
  45. });
  46. ajax.setLoading("modifyBtn", '正在提交', {disabled:true});
  47. ajax.execute();
  48. }
  49. //发送验证码
  50. function doSendSmsCode(){
  51. var operatorMobile = Z("#operatorMobile").val();
  52. if (Z.V.isEmptyBlank(operatorMobile))
  53. {
  54. Z.failure("手机号不能为空!");
  55. Z("#operatorMobile").focus();
  56. return;
  57. }
  58. if (Z('#getsms-submit')[0].innerHTML != "获取验证码" && Z('#getsms-submit')[0].innerHTML != "重新发送") {
  59. Z.failure("请稍后再试");
  60. return ;
  61. }
  62. var ajax = new Z.Ajax();
  63. ajax.setContextPath("${context.getContextPath()}");
  64. ajax.setClassName("ZmrLoginPresenter");
  65. ajax.setMethodName("sendSmsRestPass");
  66. ajax.addParam("operatorMobile", operatorMobile);
  67. ajax.setFailureAlert();
  68. ajax.setSuccess();
  69. ajax.execute();
  70. setYzmLabel();
  71. }
  72. var wait = 60;
  73. function setYzmLabel() {
  74. if (wait == 0)
  75. {
  76. Z('#getsms-submit')[0].innerHTML = "重新发送";
  77. wait = 60;
  78. }
  79. else
  80. {
  81. Z('#getsms-submit')[0].innerHTML = "已发送(" + wait + ")";
  82. wait--;
  83. setTimeout(function () {
  84. setYzmLabel()
  85. }, 1000);
  86. }
  87. };
  88. </script>
  89. <div class="reg-box">
  90. <div class="header">欢迎注册 [ ${context.getContextName()} ]!</div>
  91. <div class="reg-login p-login">
  92. <div class="design-logo p-int"><img src="ztmpl/zhiqim_manager/designLogo.png"></div>
  93. <div class="reg">
  94. <div class="reg-title">已有账号?<a href="/">马上登录</a></div>
  95. <div class="reg-h">重置密码</div>
  96. <div class="reg-list">
  97. <span>手机号码:</span>
  98. <input type="tel" id="operatorMobile" name="operatorMobile" data-options="type:Integer;" placeholder="请输入手机号码" maxlength="11" autocomplete="off" />
  99. </div>
  100. <div class="reg-list">
  101. <span>验证码:</span>
  102. <input id="smsCode" name="smsCode" class="input-code" data-options="type:Integer;" placeholder="请输入验证码" maxlength="6" autocomplete="off" />
  103. <button id="getsms-submit" onclick="doSendSmsCode()">获取验证码</button>
  104. </div>
  105. <div class="reg-list">
  106. <span>新密码:</span>
  107. <input type="password" name="operatorPass" id="operatorPass" placeholder="请输入登录密码" maxlength="16" autocomplete="off" />
  108. </div>
  109. <div class="reg-list">
  110. <span>确认密码:</span>
  111. <input type="password" name="operatorNewPass" id="operatorNewPass" placeholder="请再次输入登录密码" maxlength="16" autocomplete="off" />
  112. </div>
  113. <button id="modifyBtn" class="reg-btn p-btn" onclick="resetPass()">确认</button>
  114. </div>
  115. </div>
  116. <div class="footer">Copyright © 2023 领淘众创 All Rights Reserved <a href="https://beian.miit.gov.cn/" style="color: white" target="_blank">备案号:闽ICP备2023014112号-1 </a></div>
  117. </div>