浏览代码

直播清楚缓存接口按钮

yuhongqi 1 月之前
父节点
当前提交
cd18fc5102
共有 2 个文件被更改,包括 42 次插入1 次删除
  1. 9 1
      src/api/live/live.js
  2. 33 0
      src/views/live/live/index.vue

+ 9 - 1
src/api/live/live.js

@@ -157,4 +157,12 @@ export function getTagsListByCorpId(qwTagGroup) {
     method: 'get',
     params:qwTagGroup
   })
-}
+}
+
+// 清除直播间缓存
+export function clearLiveCache(liveId) {
+  return request({
+    url: '/live/live/clearCache/' + liveId,
+    method: 'post'
+  })
+}

+ 33 - 0
src/views/live/live/index.vue

@@ -200,6 +200,12 @@
       @selection-change="handleSelectionChange"
     >
       <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column
+        label="直播ID"
+        align="center"
+        prop="liveId"
+        width="100"
+      />
       <el-table-column
         label="直播封面"
         align="center"
@@ -303,6 +309,14 @@
             v-hasPermi="['live:console:list']"
             >进入直播间</el-button
           >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleClearCache(scope.row)"
+            v-hasPermi="['live:live:edit']"
+            >清理缓存</el-button
+          >
           <el-dropdown trigger="hover">
             <el-button size="mini" type="text" icon="el-icon-more">
               更多
@@ -670,6 +684,7 @@ import {
   getCompanyDropList,
   getQwCorpList,
   getTagsListByCorpId,
+  clearLiveCache,
 } from "@/api/live/live";
 import Editor from "@/components/Editor/wang";
 import user from "@/store/modules/user";
@@ -1299,6 +1314,24 @@ export default {
         })
         .catch(() => {});
     },
+    /** 清理缓存按钮操作 */
+    handleClearCache(row) {
+      this.$confirm("是否确认清理该直播间的缓存?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          clearLiveCache(row.liveId).then((response) => {
+            if (response.code === 200) {
+              this.msgSuccess("缓存清理成功");
+            } else {
+              this.msgError(response.msg || "缓存清理失败");
+            }
+          });
+        })
+        .catch(() => {});
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;