链接全转https协议,去除获取在线预览链接,改为本地生成,修复部分bug,优化预览图(同步更新)
This commit is contained in:
+8
-49
@@ -74,26 +74,6 @@ const actions = {
|
||||
ElMessage("查询失败")
|
||||
})
|
||||
},
|
||||
queryOnlineLinks(context, gid){
|
||||
// 如果本地有缓存,则直接返回,没有再请求
|
||||
if(context.state.onlineLinks[gid] !== undefined){
|
||||
context.commit("_setOnlineLinks", gid)
|
||||
}
|
||||
else {
|
||||
axios.get(GalleryManageUrl + "/onlineLinks", {
|
||||
params: {
|
||||
AuthCode: state.AuthCode,
|
||||
gid,
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.data.result === "success")
|
||||
context.commit("_addAndSetOnlineLinks", {gid, links: res.data.data})
|
||||
|
||||
else
|
||||
ElMessage(res.data.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
updateGallery(context, link){
|
||||
axios.post(GalleryManageUrl + "/update", qs.stringify({AuthCode: state.AuthCode, link}))
|
||||
.then((res) => {
|
||||
@@ -310,9 +290,12 @@ const mutations = {
|
||||
break;
|
||||
case "下载完成":
|
||||
task.progress = "下载完成"
|
||||
let tempLink
|
||||
tempLink = task.link.replace("element-plus.org", "exhentai.org").replace("element.org", "e-hentai.org")
|
||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name.replace("#", "")) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode
|
||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode
|
||||
let links = []
|
||||
for(let i=1; i<=task.pages; i++)
|
||||
links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid);
|
||||
|
||||
task.images = links
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -353,7 +336,7 @@ const mutations = {
|
||||
preDeleteIndex = -1
|
||||
if(task.status !== "下载完成")
|
||||
for(let i=0; i < tasks.length; i++)
|
||||
if(tasks[i].name === task.name) {
|
||||
if(tasks[i] !== undefined && tasks[i].name === task.name) {
|
||||
preDeleteIndex = i
|
||||
task.status = tasks[i].status
|
||||
task.proceeding = tasks[i].proceeding
|
||||
@@ -571,27 +554,6 @@ const mutations = {
|
||||
else
|
||||
state.length = state.defaultLength
|
||||
},
|
||||
_addAndSetOnlineLinks(state, data){
|
||||
let links = JSON.parse(data.links)
|
||||
state.onlineLinks[data.gid] = []
|
||||
state.currentLinks.splice(0)
|
||||
state.currentGid = data.gid
|
||||
|
||||
links.forEach((link) => {
|
||||
state.onlineLinks[data.gid].push('https://downloader.lionwebsite.xyz/GalleryManage/onlineImage/' + link + '?gid=' + state.currentGid + '&AuthCode=' + state.AuthCode)
|
||||
state.currentLinks.push('https://downloader.lionwebsite.xyz/GalleryManage/onlineImage/' + link + '?gid=' + state.currentGid + '&AuthCode=' + state.AuthCode)
|
||||
})
|
||||
|
||||
state.isOnlineReading = true
|
||||
},
|
||||
_setOnlineLinks(state, gid){
|
||||
state.currentLinks.splice(0)
|
||||
state.onlineLinks[gid].forEach((link) => {
|
||||
state.currentLinks.push(link)
|
||||
})
|
||||
state.currentGid = gid
|
||||
state.isOnlineReading = true
|
||||
},
|
||||
_openHistoryPanel(state){
|
||||
state.isShowHistory = true
|
||||
},
|
||||
@@ -600,7 +562,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 + "/onlineImage/1?gid="+gallery.gid
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,10 +575,7 @@ const state = {
|
||||
tags: new Map(), //可用tag
|
||||
isSearch: false, //用于决定是否显示搜索结果
|
||||
|
||||
onlineLinks: {}, //在线本子链接
|
||||
isOnlineReading: false, //是否在线看
|
||||
currentGid: "", //当前GID
|
||||
currentLinks: [], //当前本子链接
|
||||
lengthPerPage: 0, //在线预览每页图片数量
|
||||
|
||||
page: 1, //当前页数
|
||||
|
||||
Reference in New Issue
Block a user