update-password.html 2.6 KB

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