resetPwd.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('修改用户密码')" />
  5. </head>
  6. <body class="white-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  8. <form class="form-horizontal m" id="form-user-resetPwd">
  9. <input name="userId" type="hidden" th:value="${user.userId}" />
  10. <div class="form-group">
  11. <label class="col-sm-3 control-label">登录名称:</label>
  12. <div class="col-sm-8">
  13. <input class="form-control" type="text" readonly="true" name="loginName" th:value="${user.loginName}"/>
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-sm-3 control-label">旧密码:</label>
  18. <div class="col-sm-8">
  19. <input class="form-control" type="password" name="oldPassword" id="oldPassword">
  20. </div>
  21. </div>
  22. <div class="form-group">
  23. <label class="col-sm-3 control-label">新密码:</label>
  24. <div class="col-sm-8">
  25. <input class="form-control" type="password" name="newPassword" id="newPassword">
  26. <th:block th:with="chrtype=${@config.getKey('sys.account.chrtype')}">
  27. <th:block th:if="${chrtype != '0'}">
  28. <span class="help-block m-b-none">
  29. <th:block th:if="${chrtype == '1'}"><i class="fa fa-info-circle" style="color: red;"></i> 密码只能为0-9数字 </th:block>
  30. <th:block th:if="${chrtype == '2'}"><i class="fa fa-info-circle" style="color: red;"></i> 密码只能为a-z和A-Z字母</th:block>
  31. <th:block th:if="${chrtype == '3'}"><i class="fa fa-info-circle" style="color: red;"></i> 密码必须包含(字母,数字)</th:block>
  32. <th:block th:if="${chrtype == '4'}"><i class="fa fa-info-circle" style="color: red;"></i> 密码必须包含(字母,数字,特殊字符!@#$%^&*()-=_+)</th:block>
  33. </span>
  34. </th:block>
  35. </th:block>
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label class="col-sm-3 control-label">再次确认:</label>
  40. <div class="col-sm-8">
  41. <input class="form-control" type="password" name="confirmPassword" id="confirmPassword">
  42. <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
  43. </div>
  44. </div>
  45. </form>
  46. </div>
  47. <th:block th:include="include :: footer" />
  48. <script>
  49. $("#form-user-resetPwd").validate({
  50. rules:{
  51. oldPassword:{
  52. required:true,
  53. remote: {
  54. url: ctx + "system/user/profile/checkPassword",
  55. type: "get",
  56. dataType: "json",
  57. data: {
  58. password: function() {
  59. return $("input[name='oldPassword']").val();
  60. }
  61. }
  62. }
  63. },
  64. newPassword: {
  65. required: true,
  66. minlength: 5,
  67. maxlength: 20
  68. },
  69. confirmPassword: {
  70. required: true,
  71. equalTo: "#newPassword"
  72. }
  73. },
  74. messages: {
  75. oldPassword: {
  76. required: "请输入原密码",
  77. remote: "原密码错误"
  78. },
  79. newPassword: {
  80. required: "请输入新密码",
  81. minlength: "密码不能小于5个字符",
  82. maxlength: "密码不能大于20个字符"
  83. },
  84. confirmPassword: {
  85. required: "请再次输入新密码",
  86. equalTo: "两次密码输入不一致"
  87. }
  88. },
  89. focusCleanup: true
  90. });
  91. function submitHandler() {
  92. var chrtype = [[${#strings.defaultString(@config.getKey('sys.account.chrtype'), 0)}]];
  93. var password = $("#newPassword").val();
  94. if ($.validate.form() && checkpwd(chrtype, password)) {
  95. $.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize());
  96. }
  97. }
  98. </script>
  99. </body>
  100. </html>