index.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. {include file="public/frame_head"}
  2. <style>
  3. .panel button{display: block;margin:5px;}
  4. .clear_tit span{font-size: 12px; color: #ED4014;margin: 15px 0;}
  5. .clear_box{border: 1px solid #DADFE6;border-radius: 3px;display: flex;flex-direction: column;align-items: center;padding: 30px 10px;box-sizing:border-box}
  6. .clear_box_sp1{font-size: 16px;color: #000000;display: block;}
  7. .clear_box_sp2{font-size: 14px;color: #808695;display: block;margin: 12px 0;}
  8. .layui-btn-danger {background-color: #FF5722;}
  9. </style>
  10. <div class="layui-fluid">
  11. <div class="layui-row layui-col-space15" id="app">
  12. <div class="layui-col-md12">
  13. <div class="layui-card">
  14. <div class="layui-card-body">
  15. <blockquote class="layui-elem-quote layui-quote-nm">
  16. 清除数据请谨慎,清除就无法恢复哦!
  17. </blockquote>
  18. <div class="clear_box layui-col-md3 layui-col-lg3 layui-col-sm3" v-for="item in clearData">
  19. <span class="clear_box_sp1">{{item.name}}</span>
  20. <span class="clear_box_sp2" v-if="item.info">{{item.info}}</span>
  21. <button type="primary" :class="item.class ? item.class : 'layui-btn-danger' " class="layui-btn cleardata" @click="unDate(item)">{{item.button ? item.button : '立即清理'}}</button>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. <!--<button type="button" class="btn btn-w-m btn-danger btn-primary creatuser" data-url="{:Url('system.SystemCleardata/userdate')}">创建前台用户用户名:crmeb 密码:123456</button>-->
  29. </div>
  30. <script type="text/javascript" src="/static/plug/vue/dist/vue.min.js"></script>
  31. <script>
  32. new Vue({
  33. data:{
  34. clearData:[
  35. {
  36. name:'更换域名',
  37. info:'替换所有本地上传的图片域名',
  38. url:"{:Url('system.SystemCleardata/undata',['type'=>3])}",
  39. act:'replace',
  40. button:'立即更换',
  41. class:'layui-btn-normal',
  42. },
  43. {
  44. name:'清除用户生成的临时附件',
  45. info:'清除用户生成的临时附件,不会影响产品图',
  46. url:"{:Url('system.SystemCleardata/undata',['type'=>1])}"
  47. },
  48. {
  49. name: '清除回收站产品',
  50. info:'清除回收站产品,谨慎操作',
  51. url: "{:Url('system.SystemCleardata/undata',['type'=>2])}",
  52. },
  53. {
  54. name:'清除用户数据',
  55. info:'用户相关的所有表都将被清除,谨慎操作',
  56. url: "{:Url('system.SystemCleardata/userRelevantData')}",
  57. },
  58. {
  59. name:'清除商城数据',
  60. info:'清除商城数据,谨慎操作',
  61. url: "{:Url('system.SystemCleardata/storeData')}",
  62. },
  63. {
  64. name:'清除产品分类',
  65. info:"会清除所有产品分类,谨慎操作",
  66. url:"{:Url('system.SystemCleardata/categoryData')}",
  67. },
  68. {
  69. name:"清除订单数据",
  70. info:'清除用户所有订单数据,谨慎操作',
  71. url:"{:Url('system.SystemCleardata/orderData')}",
  72. },
  73. {
  74. name:'清除客服数据',
  75. info:'清除添加的客服数据,谨慎操作',
  76. url:"{:Url('system.SystemCleardata/kefuData')}",
  77. },
  78. {
  79. name:'清除微信数据',
  80. info:'清除微信菜单保存数据,微信关键字无效回复',
  81. url:"{:Url('system.SystemCleardata/wechatData')}",
  82. },
  83. {
  84. name:'清除微信用户',
  85. info:"清除用户表和微信用户表,谨慎操作",
  86. url:"{:Url('system.SystemCleardata/wechatuserData')}"
  87. },
  88. {
  89. name:'清除内容分类',
  90. info:'清除添加的文章和文章分类,谨慎操作',
  91. url:"{:Url('system.SystemCleardata/articleData')}",
  92. },
  93. {
  94. name:'清除所有附件',
  95. info:'清除所有附件用户生成和后台上传,谨慎操作',
  96. url:"{:Url('system.SystemCleardata/uploadData')}",
  97. },
  98. {
  99. name:'清除系统记录',
  100. info:'清除系统记录,谨慎操作',
  101. url:"{:Url('system.SystemCleardata/systemdata')}",
  102. }
  103. ],
  104. },
  105. methods:{
  106. unDate:function (item) {
  107. if(item.act !== undefined && item.act)
  108. return this[item.act] && this[item.act](item);
  109. $eb.$swal('delete',function(){
  110. $eb.axios.get(item.url).then(function(res){
  111. if(res.status == 200 && res.data.code == 200) {
  112. $eb.$swal('success',res.data.msg);
  113. }else
  114. return Promise.reject(res.data.msg || '操作失败')
  115. }).catch(function(err){
  116. $eb.$swal('error',typeof err == 'object' ? err.toString() : err);
  117. });
  118. },{'title':'您确定要'+item.name+'吗?','text':'数据清除无法恢复','confirm':'是的,我要操作'})
  119. },
  120. replace:function (item) {
  121. var re = /^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*$/;
  122. $eb.$alert('textarea',{title:'请输入需要替换的域名,格式为:http://域名。替换规则:会使用当前[设置]里面的[网站域名]去替换成当前您输入的域名,替换成功后再去更换[网站域名]'},function (res) {
  123. if(!res)
  124. return $eb.$swal('error','请输入需要替换的域名');
  125. if(!re.test(res))
  126. return $eb.$swal('error','请输入正确的域名');
  127. $eb.axios.post(item.url,{value:res}).then(function(res){
  128. if(res.status == 200 && res.data.code == 200) {
  129. $eb.$swal('success',res.data.msg);
  130. }else
  131. return Promise.reject(res.data.msg || '操作失败')
  132. }).catch(function(err){
  133. $eb.$swal('error',typeof err == 'object' ? err.toString() : err);
  134. });
  135. });
  136. }
  137. },
  138. mounted:function () {
  139. }
  140. }).$mount(document.getElementById('app'));
  141. </script>
  142. {include file="public/inner_footer"}