index.php 7.6 KB

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