update-password.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>修改密码</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <!-- 所有的 css & js 资源 -->
  7. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  8. <link rel="stylesheet" href="../../static/sa.css">
  9. <script src="../../static/kj/vue.min.js"></script>
  10. <script src="../../static/kj/element-ui/index.js"></script>
  11. <script src="../../static/kj/jquery.min.js"></script>
  12. <script src="../../static/kj/layer/layer.js"></script>
  13. <script src="../../static/sa.js"></script>
  14. <style>
  15. /* body,.sbot.vue-box{background-color: #EEE !important;} */
  16. .c-item .c-label{width: 10em;}
  17. .c-item .el-input__inner{width: 300px;}
  18. </style>
  19. </head>
  20. <body>
  21. <div class="vue-box sbot" style="display: none;" :style="'display: block;'">
  22. <!-- ------- 内容部分 ------- -->
  23. <div class="s-body">
  24. <div class="c-panel">
  25. <div class="c-title">数据添加</div>
  26. <el-form v-if="m">
  27. <sa-item type="password" name="旧密码" v-model="m.oldPwd" br></sa-item>
  28. <sa-item type="password" name="再次输入旧密码" v-model="m.oldPwd2" br></sa-item>
  29. <sa-item type="password" name="新密码" v-model="m.newPwd" br></sa-item>
  30. <sa-item type="password" name="再次输入新密码" v-model="m.newPwd2" br></sa-item>
  31. </el-form>
  32. </div>
  33. </div>
  34. <!-- ------- 底部按钮 ------- -->
  35. <div class="s-foot">
  36. <el-button type="primary" @click="ok()">确定</el-button>
  37. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  38. </div>
  39. </div>
  40. <script>
  41. var app = new Vue({
  42. components: {
  43. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
  44. },
  45. el: '.vue-box',
  46. data: {
  47. sa: sa,
  48. m: {
  49. oldPwd: '',
  50. oldPwd2: '',
  51. newPwd: '',
  52. newPwd2: ''
  53. },
  54. },
  55. methods: {
  56. // 提交
  57. ok: function() {
  58. // 表单校验
  59. let m = this.m;
  60. sa.checkNull(m.oldPwd && m.oldPwd2 && m.newPwd && m.newPwd2, '请填写');
  61. sa.check(m.oldPwd != m.oldPwd2, '旧密码两次输入不一致');
  62. sa.check(m.newPwd != m.newPwd2, '新密码两次输入不一致');
  63. sa.check(m.newPwd.length < 4, '新密码请不要低于六位数');
  64. // 开始修改
  65. sa.ajax('/AdminPassword/update', this.m, function(res) {
  66. if(parent != window) {
  67. sa.closeCurrIframe();
  68. parent.sa.ok2('修改成功');
  69. }
  70. })
  71. //sa.$fast.fastUpdate2('/SysUser/updatePassword', this.m);
  72. },
  73. },
  74. mounted: function() {
  75. }
  76. })
  77. </script>
  78. </body>
  79. </html>