From 77d771f98a85d9f91d098cbfb7daa451ddb88492 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Mon, 2 Jan 2023 15:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E6=9C=AC=E5=AD=90=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=88=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Side.vue | 4 ++++ src/store/index.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/components/Side.vue b/src/components/Side.vue index 2794b2e..9eaeff5 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -17,6 +17,7 @@ {{props.row.isCollect ? '取消收藏' : '收藏'}} 编辑标签 + 更新 @@ -264,6 +265,9 @@ function submitTag(){ function downloadTask(link){ window.open(link) } +function updateGallery(link){ + store.dispatch("updateGallery", link) +} function deleteGallery(gid){ store.dispatch("deleteGallery", gid) } diff --git a/src/store/index.js b/src/store/index.js index 1968831..89c762d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -116,6 +116,20 @@ const actions = { ElMessage("查询失败") }) }, + updateGallery(context, link){ + axios.post(GalleryManageUrl + "/update", qs.stringify({AuthCode: state.AuthCode, link})) + .then((res) => { + if(res.data.result === 'success' && state.refreshTimer === 0){ + setTimeout(() => { + context.dispatch("updateGalleryTasks", "all").then() + }, 5000) + state.refreshTimer = setInterval(() => { + context.dispatch("updateGalleryTasks", "undone").then() + }, 20000) + } + ElMessage(res.data.data) + }) + }, validate(context, AuthCode){ axios.post(BaseUrl + "validate?AuthCode=" + AuthCode).then((res)=>{ if(res.data.result === 'success'){