diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index 8dcfa9a..c74eedb 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -1,15 +1,14 @@ @@ -111,15 +111,15 @@ export default { }) let isShowVideoHistory = computed(() => { - return store.getters.showType === "video" + return store.state.showType === "video" }) let isShowGalleryHistory = computed(() => { - return store.getters.showType === "gallery" + return store.state.showType === "gallery" }) let isOpenHistoryPanel = computed(() => { - return store.getters.isShowHistory + return store.state.isShowHistory }) let min = computed(() => { @@ -133,12 +133,12 @@ export default { }) let page = computed(() => { - targetPage.value = store.getters.page - return store.getters.page + targetPage.value = store.state.page + return store.state.page }) let loadComplete = computed(() => { - return store.getters.loadComplete + return store.state.loadComplete }) function next() { @@ -165,7 +165,6 @@ export default { targetPage.value = min.value } - function changePage(){ if(targetPage.value >= min.value && targetPage.value <= max.value) store.commit("_changePage", targetPage.value) @@ -199,8 +198,8 @@ export default { window.open("http://zfile.lionwebsite.xyz/1/gallery/" + encodeURI(name)) } - function onlineVideoViewer(name){ - window.open("http://zfile.lionwebsite.xyz/1/video/" + encodeURI(name + ".mp4")) + function onlineVideoViewer(){ + window.open("http://zfile.lionwebsite.xyz/1/video/") } function changeShowType(){ @@ -214,8 +213,8 @@ export default { } } - function operational(task){ - return task === null + function operational(download){ + return download === undefined } diff --git a/src/store/index.js b/src/store/index.js index 47e47eb..1f41dd7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -3,8 +3,8 @@ import axios from "axios" import {ElMessage} from "element-plus" import qs from "qs" const BaseUrl = "http://downloader.lionwebsite.xyz/" -const GalleryTaskHandlerUrl = BaseUrl + "GalleryTaskHandler/" -const VideoTaskHandlerUrl = BaseUrl + "VideoTaskHandler/" +const GalleryTaskHandlerUrl = BaseUrl + "GalleryManage/" +const VideoTaskHandlerUrl = BaseUrl + "VideoManage/" const actions = { updateGalleryTasks(context){ @@ -121,6 +121,7 @@ const actions = { context.dispatch("updateGalleryTasks").then() context.dispatch("updateVideoTasks").then() context.dispatch("loadMaskDomain").then() + context.dispatch("loadWeekUsedAmount").then() setInterval(() => { context.dispatch("update").then() }, 30000) @@ -143,6 +144,19 @@ const actions = { } }) }, + loadWeekUsedAmount(context){ + axios.get(GalleryTaskHandlerUrl + "weekUsedAmount", { + params: { + AuthCode: context.state.AuthCode + } + }).then((res) => { + if(res.data.result === "success"){ + context.state.weekUsed = JSON.parse(res.data.data) + }else{ + ElMessage("查询用量失败") + } + }) + }, searchByLink(context, link){ context.commit("_searchByLink", link) }, @@ -303,6 +317,7 @@ const mutations = { if(data.gallery === false) { state.preDownloadGallery.resolution = data.resolution state.preDownloadGallery.fileSize = "等待下载完成后再查看" + state.preDownloadGallery.progress = "已提交" state.totalGalleryTask.push(state.preDownloadGallery) } state.preDownloadGallery = data.gallery @@ -312,6 +327,7 @@ const mutations = { state.preDownloadVideo.resolution = data.resolution state.preDownloadVideo.fileSize = "下载完成后再查看" state.preDownloadVideo.duration = "下载完成后再查看" + state.preDownloadVideo.progress = "已提交" state.totalVideoTask.push(state.preDownloadVideo) } state.preDownloadVideo = data.video @@ -347,7 +363,8 @@ const state = { isInclude:false, //是否搜索到任务 searchTask:[], //搜索到的任务 isShowHistory:false, //是否打开面板 - showType:"gallery", + showType:"gallery", //展示类型 + weekUsed:{}, maskDomain:[] } @@ -376,10 +393,10 @@ const getters = { if(state.searchTask.length !== 0){ tasks = state.searchTask } - else if(state.showHistory === "gallery") + else if(state.showType === "gallery") if(state.totalGalleryTask.length !== 0) tasks = state.totalGalleryTask - else if(state.showHistory === "video") + else if(state.showType === "video") if(state.totalVideoTask.length) tasks = state.totalVideoTask if(!tasks) @@ -389,30 +406,6 @@ const getters = { max += 1 } return max - }, - isAuth(state){ - return state.isAuth - }, - page(state){ - return state.page - }, - loadComplete(state){ - return state.loadComplete - }, - preDownloadGallery(state){ - return state.preDownloadGallery - }, - preDownloadVideo(state){ - return state.preDownloadVideo - }, - isShowHistory(state){ - return state.isShowHistory - }, - showType(state){ - return state.showType - }, - maskDomain(state){ - return state.maskDomain } }