logout.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <include file="public@header"/>
  2. </head>
  3. <body>
  4. <div class="wrap">
  5. <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="#">
  6. <div class="form-group">
  7. <label for="input-password" class="col-sm-2 control-label"><span class="form-required">*</span>登录密码</label>
  8. <input type="password" class="form-control" id="input-password" style="width: 200px;display: inline-block;" name="password" placeholder="请输入登录密码确认">
  9. </div>
  10. <div class="form-group">
  11. <div class="col-sm-offset-2 col-sm-10 text-center margin-top-20">
  12. <input type="hidden" name="id" value="{$id}"/>
  13. <button type="button" class="btn btn-primary" onclick="return condtion();">确认注销</button>
  14. </div>
  15. </div>
  16. </form>
  17. </div>
  18. <link href="__STATIC__/js/city/layui/css/layui.css" rel="stylesheet"/>
  19. <script src="__STATIC__/js/city/layui/layui.js" type="text/javascript"></script>
  20. <script src="__STATIC__/js/admin.js"></script>
  21. <script type="text/javascript">
  22. function condtion() {
  23. if ($('#input-password').val() == '') {
  24. alert('请输入登录密码二次确认');
  25. return false;
  26. }
  27. if (confirm('确定要注销该账号吗?')) {
  28. $.ajax({
  29. type: 'post',
  30. url: "{:url('/User/admin_index/dologout',array('id'=>$id))}",
  31. data: {password: $('#input-password').val()},
  32. success: function (data) {
  33. if (data.code == 1) {
  34. alert(data.msg);
  35. var index = parent.layer.getFrameIndex(window.name);
  36. parent.layer.close(index);
  37. } else {
  38. console.log(9999)
  39. alert(data.msg);
  40. }
  41. return false;
  42. },
  43. fail: function (data) {
  44. alert(data.msg);
  45. }
  46. });
  47. return false;
  48. } else {
  49. return false;
  50. }
  51. }
  52. </script>
  53. </body>
  54. </html>