截流自动化的商城平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

password.html 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {layout name="layout2" /}
  2. <div class="wrapper">
  3. <div class="layui-card">
  4. <div class="layui-card-header">修改密码</div>
  5. <div class="layui-card-body" pad15>
  6. <div class="layui-form" lay-filter="">
  7. <div class="layui-form-item">
  8. <label class="layui-form-label">账号</label>
  9. <div class="layui-input-inline">
  10. <div class="layui-form-mid layui-word-aux">{$account}</div>
  11. </div>
  12. </div>
  13. <div class="layui-form-item">
  14. <label class="layui-form-label">当前密码</label>
  15. <div class="layui-input-inline">
  16. <input type="password" name="old_password" lay-verify="required" lay-verType="tips"
  17. class="layui-input">
  18. </div>
  19. </div>
  20. <div class="layui-form-item">
  21. <label class="layui-form-label">新密码</label>
  22. <div class="layui-input-inline">
  23. <input type="password" maxlength="16" name="password" lay-verify="required|length"
  24. lay-verType="tips" autocomplete="off" class="layui-input">
  25. </div>
  26. <div class="layui-form-mid layui-word-aux">6到16个字符</div>
  27. </div>
  28. <div class="layui-form-item">
  29. <label class="layui-form-label">确认新密码</label>
  30. <div class="layui-input-inline">
  31. <input type="password" name="re_password" lay-verify="required|comparison" lay-verType="tips"
  32. autocomplete="off" class="layui-input">
  33. </div>
  34. </div>
  35. <div class="layui-form-item">
  36. <div class="layui-input-block">
  37. <button class="layui-btn {$view_theme_color}" lay-submit lay-filter="setmypass">确认修改</button>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <script>
  45. layui.use(['table'], function () {
  46. var $ = layui.$
  47. , form = layui.form;
  48. form.verify({
  49. length: function (value, item) {
  50. if (value.length < 6 || value.length > 16) {
  51. return '长度为' + 6 + '到' + 16 + '之间';
  52. }
  53. },
  54. comparison: function (value, item) {
  55. password = layui.$('[name=password]').val();
  56. if (password != value) {
  57. return '两次密码输入不一致';
  58. }
  59. }
  60. });
  61. form.on('submit(setmypass)', function (data) {
  62. like.ajax({
  63. url: '{:url()}'
  64. , data: data.field
  65. , type: 'post'
  66. , success: function (res) {
  67. if(res.code == 1) {
  68. layui.layer.msg(res.msg, {
  69. offset: '15px'
  70. , icon: 1
  71. , time: 1000
  72. }, function () {
  73. location.href = location.href;
  74. });
  75. }
  76. }
  77. });
  78. });
  79. });
  80. </script>