From aca3da4b7bb448dddde441715095ae1749226b62 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Wed, 28 Dec 2022 17:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E6=8A=96=E5=8A=A8,=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Side.vue | 6 +++++- src/store/index.js | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/Side.vue b/src/components/Side.vue index d7ff26d..c3f7cd3 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -122,6 +122,7 @@ export default { let showType = ref("gallery") // gallery video let sortType = ref("shortName") // shortName name createTime let targetPage = ref(1) + let debounceTimer = 0 let loadComplete = computed(() => { return store.state.loadComplete @@ -252,7 +253,10 @@ export default { function showThumbnail(gallery){ if(gallery.download !== undefined) - store.commit("_changeThumbnailGallery", gallery) + clearTimeout(debounceTimer) + debounceTimer = setTimeout(() => { + store.commit("_changeThumbnailGallery", gallery) + }, 500) } return {galleryTasks, videoTasks, min, max, targetPage, loadComplete, page, isEditing, inputNode, isShowVideoHistory, diff --git a/src/store/index.js b/src/store/index.js index 18c2fb3..dc806ba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -4,8 +4,8 @@ import {ElMessage} from "element-plus" import qs from "qs" import moment from 'moment' const BaseUrl = "http://downloader.lionwebsite.xyz/" -const GalleryManageUrl = BaseUrl + "GalleryManage/" -const VideoManageUrl = BaseUrl + "VideoManage/" +const GalleryManageUrl = BaseUrl + "GalleryManage" +const VideoManageUrl = BaseUrl + "VideoManage" const actions = { updateGalleryTasks(context, type){ @@ -136,7 +136,7 @@ const actions = { }) }, loadWeekUsedAmount(context){ - axios.get(GalleryManageUrl + "weekUsedAmount", { + axios.get(GalleryManageUrl + "/weekUsedAmount", { params: { AuthCode: state.AuthCode } @@ -273,7 +273,7 @@ const mutations = { if (url.host === mask['raw']) tempLink = task.link.replace(mask['raw'], mask['mask']) }) - task.download = GalleryManageUrl + "file/" + encodeURI(task.name) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode + task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode break; } @@ -341,7 +341,7 @@ const mutations = { if (url.host === mask['raw']) tempLink = task.link.replace(mask['raw'], mask['mask']) }) - task.download = VideoManageUrl + "file/" + encodeURI(task.name) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode + task.download = VideoManageUrl + "/file/" + encodeURI(task.name) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode task.createTimeDisplay = moment(task.createTime * 1000).format("YYYY-MM-DD HH:mm:ss") } state.totalVideoTask.push(task) @@ -501,7 +501,7 @@ const mutations = { }, _changeThumbnailGallery(state, gallery){ state.thumbnailGallery = gallery - state.thumbnailGallery.url = GalleryManageUrl + "thumbnail/" + encodeURIComponent(gallery.name) + ".webp?AuthCode="+state.AuthCode + state.thumbnailGallery.url = GalleryManageUrl + "/thumbnail/" + encodeURIComponent(gallery.name) + ".webp?AuthCode="+state.AuthCode } }