From 85b8a8c2a3e0e90a3ad5ef2edee60050a7fcf693 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Thu, 21 Dec 2023 18:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E6=8B=A9;=E6=96=B0=E5=A2=9E=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=89=8D=E6=9F=A5=E7=9C=8B=E9=A2=84=E8=A7=88=E5=9B=BE?= =?UTF-8?q?;=E5=8E=BB=E9=99=A4=E9=93=BE=E6=8E=A5=E4=BC=AA=E8=A3=85;?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E8=BD=BD=E5=AE=8C=E6=88=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A4=E6=96=AD;=E4=BB=85=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=87=8C=E7=AB=99=E9=93=BE=E6=8E=A5(?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DashBoard.vue | 33 +++++++++++++++++++++++---------- src/components/HentaiSearch.vue | 13 ++++--------- src/components/Side.vue | 10 +++++----- src/store/index.js | 27 +++++++++++++++++---------- 4 files changed, 49 insertions(+), 34 deletions(-) diff --git a/src/components/DashBoard.vue b/src/components/DashBoard.vue index b8994af..018e188 100644 --- a/src/components/DashBoard.vue +++ b/src/components/DashBoard.vue @@ -47,12 +47,15 @@
+ style="width: 300px; height: 250px" fit="contain"/> + 本子名字:{{chosenGallery.name}}本子页数:{{chosenGallery.pages}} @@ -67,9 +70,16 @@ + 下载模式: + + + + + + 标签: - {{store.state.tags.get(tid).tag}} - + {{store.state.tags.get(tid).tag}} +
@@ -194,6 +204,7 @@ let param = ref("") let paramForTags = ref([]) //tidS let targetResolution = ref("") +let targetDownloadMode = ref("") let tag = ref("") let tagKeyWord = ref("") //查询tag的关键字 @@ -278,10 +289,14 @@ function postTask(){ ElMessage("请选择分辨率再提交") return } - let tempLink = coverLink(chosenGallery.value.link) + if(targetDownloadMode.value === ''){ + ElMessage("请选择下载模式再提交") + return + } store.dispatch("postGalleryTask", - {link: tempLink, + {link: chosenGallery.value.link, targetResolution: targetResolution.value, + mode: targetDownloadMode.value, tags:paramForTags.value}) targetResolution.value = "" } @@ -292,8 +307,9 @@ function queryRemoteTask(){ ElMessage("链接错误") return } - let tempLink = coverLink(param.value) - store.dispatch("queryGalleryTask", tempLink) + if(param.value.includes("e-hentai")) + param.value = param.value.replace("e-hentai", "exhentai") + store.dispatch("queryGalleryTask", param.value) } function queryLocalTask(){ switch (type.value){ @@ -417,9 +433,6 @@ function validateLink(rawLink){ else return false } -function coverLink(rawLink){ - return rawLink.replace("exhentai.org", "element-plus.org").replace("e-hentai.org", "element.org"); -} //在线阅读以及展示缩略图 function onlineGalleryReader(gid){ diff --git a/src/components/HentaiSearch.vue b/src/components/HentaiSearch.vue index 30b849f..fc14aef 100644 --- a/src/components/HentaiSearch.vue +++ b/src/components/HentaiSearch.vue @@ -56,8 +56,7 @@ function queryRemoteTask(){ ElMessage("链接错误") return } - let tempLink = coverLink(param.value) - store.dispatch("queryGalleryTask", tempLink) + store.dispatch("queryGalleryTask", param.value) } function validateLink(rawLink){ @@ -69,10 +68,6 @@ function validateLink(rawLink){ return false } -function coverLink(rawLink){ - return rawLink.replace("exhentai.org", "element-plus.org").replace("e-hentai.org", "element.org"); -} - function close(){ emit("close") } @@ -85,8 +80,8 @@ function close(){
- 页数:{{gallery.page}}
类型:{{gallery.type}}
链接
- 下载 + 查看
diff --git a/src/components/Side.vue b/src/components/Side.vue index 65cf957..ed3e0c7 100644 --- a/src/components/Side.vue +++ b/src/components/Side.vue @@ -23,10 +23,10 @@ downloader:{{props.row.downloader}} - 删除 + 删除 编辑标签 - 更新 - 分享 + 更新 + 分享 @@ -39,9 +39,9 @@ diff --git a/src/store/index.js b/src/store/index.js index 1df6713..b93815e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -37,9 +37,7 @@ const actions = { postGalleryTask(context, data){ axios.post(GalleryManageUrl + '?' + qs.stringify({ AuthCode: state.AuthCode, - link: data.link, - targetResolution: data.targetResolution, - tags: data.tags + ...data }, {indices:false})).then((res) => { if(res.data.result === "success") { ElMessage("提交成功") @@ -293,12 +291,15 @@ const mutations = { break; case "下载完成": task.progress = "下载完成" - task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid - let links = [] - for(let i=1; i<=task.pages; i++) - links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid); + if(task.mode === 1 || task.mode === 3) + task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode + "&gid=" + task.gid - task.images = links + if(task.mode === 2 || task.mode === 3) { + let links = [] + for (let i = 1; i <= task.pages; i++) + links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid); + task.images = links + } break; case "压缩中": task.progress = "压缩中" @@ -559,8 +560,14 @@ const mutations = { state.length = state.defaultLength }, _changeThumbnailGallery(state, gallery){ - state.thumbnailGallery = gallery - state.thumbnailGallery.url = GalleryManageUrl + "/onlineImage/1?gid="+gallery.gid + if(gallery.mode === 2 || gallery.mode === 3) { + state.thumbnailGallery = gallery + state.thumbnailGallery.url = GalleryManageUrl + "/onlineImage/1?gid=" + gallery.gid + } else if(gallery.thumb_link !== undefined){ + state.thumbnailGallery = gallery + state.thumbnailGallery.url = GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link + state.thumbnailGallery.images = [GalleryManageUrl + "/ehThumbnail?path=" + gallery.thumb_link,] + } } }