新增下载模式选择;新增下载前查看预览图;去除链接伪装;优化下载完成逻辑判断;仅允许下载里站链接(同步更新)修复未下载完成时查看预览导致后端缓存异常的问题

This commit is contained in:
chuzhongzai
2023-12-21 18:32:05 +08:00
parent 01b3f08d8c
commit 1d28a89851
4 changed files with 66 additions and 33 deletions
+17 -10
View File
@@ -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("提交成功")
@@ -299,12 +297,15 @@ const mutations = {
break;
case "下载完成":
task.progress = "下载完成"
task.download = GalleryManageUrl + "/file/" + encodeURIComponent(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 = "压缩中"
@@ -573,8 +574,14 @@ const mutations = {
state.isShowHistory = false
},
_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,]
}
}
}