From dc4960cdac8cada0f6b0f15b560d668fc56582e1 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Sat, 18 Mar 2023 12:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E9=87=8C=E7=AB=99=E6=90=9C?= =?UTF-8?q?=E7=B4=A2,=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=90=8E=E7=9C=8B=E4=B8=8D=E5=88=B0downloader?= =?UTF-8?q?=E7=9A=84bug=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=90=8E=E5=86=8D=E6=AC=A1=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?bug=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/DashBoard.vue | 63 +++++++++++++++++++++++++++++++++++- src/store/index.js | 3 +- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index bd47db0..9853a88 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -23,6 +23,7 @@ 修改授权码 删除本地授权码
+ 里站搜索
{{thumbnailGallery.shortName}}
@@ -50,7 +51,7 @@ 下载 - + 在线预览 查看封面图 删除 @@ -81,6 +82,36 @@ + +
+ 查询 +
+ +
+ +
+ {{gallery.name}}

+ 上传时间:{{gallery.uploadTime}}
+ 页数:{{gallery.page}}
+ 类型:{{gallery.type}}
+ 链接
+ 下载 +
+

+
+
+ 首页 + 上一页 + 下一页 + 尾页 +
+
+

是否记住授权码 @@ -92,6 +123,7 @@ import store from "../store"; import {computed, ref, onMounted} from "vue"; import {ElMessage} from "element-plus" +import axios from "axios"; //授权码相关 let AuthCode = ref("") @@ -100,6 +132,11 @@ let isAlterAuthCode = ref(false) let newAuthCode = ref("") let tempAuthCode = ref("") +let isQuerying = ref(false) +let keyword = ref("") +let galleries = ref([]) +let queryPage = ref({}) + //查询相关 let type = ref("link") let param = ref("") @@ -182,6 +219,30 @@ function resetLocalQuery(){ store.commit("_searchLocalByTag", ['']) param.value = "" } +function queryGalleries(link){ + let tempParam + if(link !== null) { + let url = new URL(link) + tempParam = url.search.replace("?f_search=", "") + }else{ + tempParam = keyword.value + } + tempParam = tempParam.replace(" ", "+") + + axios.get("http://downloader.lionwebsite.xyz/query?keyword=" + tempParam) + .then((res) => { + let tempGalleries = JSON.parse(res.data.data) + queryPage.value.first = 'first' in res.data? res.data.first: undefined + queryPage.value.previous = 'previous' in res.data? res.data.previous: undefined + queryPage.value.next = 'next' in res.data? res.data.next: undefined + queryPage.value.last = 'last' in res.data? res.data.last: undefined + + galleries.value.splice(0) + tempGalleries.forEach((gallery) => { + galleries.value.push(gallery) + }) + }) +} function deleteGallery(){ store.dispatch("deleteGallery", chosenGallery.value.gid) diff --git a/src/store/index.js b/src/store/index.js index 9aebab2..1a1e8a2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -432,6 +432,7 @@ const mutations = { state.chosenGallery.createTimeDisplay = "等待下载完成后再查看" state.chosenGallery.progress = "已提交" state.chosenGallery.tag = "" + state.chosenGallery.downloader = state.userId state.totalGalleryTask.push(state.chosenGallery) state.downloadGallery.push(state.chosenGallery) } @@ -614,6 +615,6 @@ function deleteTask(tasks, key, value){ for(let i=0; i