resetPwd.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. </div>
  27. </div>
  28. <div class="form-group">
  29. <label class="col-sm-3 control-label">再次确认:</label>
  30. <div class="col-sm-8">
  31. <input class="form-control" type="password" name="confirm" id="confirm">
  32. <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
  33. </div>
  34. </div>
  35. </form>
  36. </div>
  37. <th:block th:include="include :: footer" />
  38. <script>
  39. $("#form-user-resetPwd").validate({
  40. rules:{
  41. oldPassword:{
  42. required:true,
  43. remote: {
  44. url: ctx + "system/user/profile/checkPassword",
  45. type: "get",
  46. dataType: "json",
  47. data: {
  48. password: function() {
  49. return $("input[name='oldPassword']").val();
  50. }
  51. }
  52. }
  53. },
  54. newPassword: {
  55. required: true,
  56. minlength: 5,
  57. maxlength: 20
  58. },
  59. confirm: {
  60. required: true,
  61. equalTo: "#newPassword"
  62. }
  63. },
  64. messages: {
  65. oldPassword: {
  66. required: "请输入原密码",
  67. remote: "原密码错误"
  68. },
  69. newPassword: {
  70. required: "请输入新密码",
  71. minlength: "密码不能小于6个字符",
  72. maxlength: "密码不能大于20个字符"
  73. },
  74. confirm: {
  75. required: "请再次输入新密码",
  76. equalTo: "两次密码输入不一致"
  77. }
  78. },
  79. focusCleanup: true
  80. });
  81. function submitHandler() {
  82. if ($.validate.form()) {
  83. $.operate.save(ctx + "system/user/profile/resetPwd", $('#form-user-resetPwd').serialize());
  84. }
  85. }
  86. </script>
  87. </body>
  88. </html>