链接全转https协议,去除获取在线预览链接,改为本地生成,修复部分bug,优化预览图(同步更新)
This commit is contained in:
parent
7126345398
commit
8e606598dd
@ -38,13 +38,14 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<el-button @click="isQuerying = true">里站搜索</el-button>
|
<el-button @click="isQuerying = true">里站搜索</el-button>
|
||||||
<el-button @click="isViewingTag = true">查看标签</el-button>
|
<el-button @click="isViewingTag = true">查看标签</el-button>
|
||||||
<div v-show="thumbnailGallery !== {}">
|
<div v-show="'images' in thumbnailGallery">
|
||||||
<span>
|
<span>
|
||||||
{{thumbnailGallery.shortName}}<br>
|
{{thumbnailGallery.shortName}}<br>
|
||||||
<el-space v-show="thumbnailGallery.tag !== ''">标签:{{thumbnailGallery.tag}}</el-space>
|
<el-space v-show="thumbnailGallery.tag !== ''">标签:{{thumbnailGallery.tag}}</el-space>
|
||||||
</span><br>
|
</span><br>
|
||||||
<picture>
|
<picture>
|
||||||
<el-image :src="thumbnailGallery.url" :preview-src-list="[thumbnailGallery.url,]" :initial-index="0" class="preview"></el-image>
|
<el-image :src="thumbnailGallery.url" :preview-src-list="thumbnailGallery.images" :initial-index="0" class="preview"
|
||||||
|
style="width: 300px; height: 300px" fit="contain"/>
|
||||||
</picture>
|
</picture>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -277,6 +278,14 @@ function postTask(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询任务
|
//查询任务
|
||||||
|
function queryRemoteTask(){
|
||||||
|
if(!validateLink(param.value)){
|
||||||
|
ElMessage("链接错误")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let tempLink = coverLink(param.value)
|
||||||
|
store.dispatch("queryGalleryTask", tempLink)
|
||||||
|
}
|
||||||
function queryLocalTask(){
|
function queryLocalTask(){
|
||||||
switch (type.value){
|
switch (type.value){
|
||||||
case "link":
|
case "link":
|
||||||
|
|||||||
@ -85,8 +85,8 @@ function close(){
|
|||||||
</div>
|
</div>
|
||||||
<el-scrollbar height="75vh" ref="scrollBar">
|
<el-scrollbar height="75vh" ref="scrollBar">
|
||||||
<div style="height: 251px; width: 100%; " v-for="gallery in galleries">
|
<div style="height: 251px; width: 100%; " v-for="gallery in galleries">
|
||||||
<el-image alt="picture" :preview-src-list="['https://cdn.lionwebsite.xyz/thumbnail' + gallery.thumbnailUrl.replace('/t', ''),]"
|
<el-image alt="picture" :preview-src-list="['https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl.replace('/t', ''),]"
|
||||||
:src="'https://cdn.lionwebsite.xyz/thumbnail' + gallery.thumbnailUrl.replace('/t', '') "
|
:src="'https://downloader.lionwebsite.xyz/GalleryManage/ehThumbnail?path=' + gallery.thumbnailUrl.replace('/t', '') "
|
||||||
style="height:250px;width:250px;float: left;"
|
style="height:250px;width:250px;float: left;"
|
||||||
fit="contain"
|
fit="contain"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {computed, ref, watch} from "vue";
|
import {computed, ref, watch} from "vue";
|
||||||
import store from "../store/index.js";
|
import store from "../store/index.js";
|
||||||
let props = defineProps(['currentLinks', 'isOnlineReading'])
|
let props = defineProps(['currentGallery', 'isOnlineReading'])
|
||||||
let isShowUp = ref()
|
let isShowUp = ref()
|
||||||
let onlineReadingScrollbar = ref()
|
let onlineReadingScrollbar = ref()
|
||||||
let links = ref()
|
let links = ref()
|
||||||
@ -19,12 +19,12 @@ watch(props, (props)=>{
|
|||||||
|
|
||||||
//切换本子
|
//切换本子
|
||||||
function alterPage(){
|
function alterPage(){
|
||||||
console.log(lengthPerPage.value, props.currentLinks.length)
|
if(props.currentGallery.images.length > lengthPerPage.value){
|
||||||
if(props.currentLinks.length > lengthPerPage.value){
|
links.value = props.currentGallery.images.slice(0, lengthPerPage.value)
|
||||||
links.value = props.currentLinks.slice(0, lengthPerPage.value)
|
max.value = Math.ceil(props.currentGallery.images.length / lengthPerPage.value)
|
||||||
max.value = Math.ceil(props.currentLinks.length / lengthPerPage.value)
|
|
||||||
}else{
|
}else{
|
||||||
links.value = props.currentLinks
|
links.value = props.currentGallery.images
|
||||||
|
max.value = 0
|
||||||
}
|
}
|
||||||
index.value = 0
|
index.value = 0
|
||||||
temp_index.value = 1
|
temp_index.value = 1
|
||||||
@ -32,7 +32,7 @@ function alterPage(){
|
|||||||
|
|
||||||
//跳转到对应页数
|
//跳转到对应页数
|
||||||
function jump(targetIndex){
|
function jump(targetIndex){
|
||||||
links.value = props.currentLinks.slice(targetIndex * lengthPerPage.value, (targetIndex + 1) * lengthPerPage.value)
|
links.value = props.currentGallery.images.slice(targetIndex * lengthPerPage.value, (targetIndex + 1) * lengthPerPage.value)
|
||||||
index.value = targetIndex
|
index.value = targetIndex
|
||||||
temp_index.value = targetIndex + 1
|
temp_index.value = targetIndex + 1
|
||||||
onlineReadingScrollbar.value.setScrollTop(0)
|
onlineReadingScrollbar.value.setScrollTop(0)
|
||||||
@ -44,16 +44,17 @@ function closeDialog(){
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="isShowUp" width="90%" style="margin-top: 0; margin-bottom: 0; padding: 0" @close="closeDialog">
|
<el-dialog v-model="isShowUp" width="90%" style="margin-top: 0; margin-bottom: 0; padding: 0" @close="closeDialog">
|
||||||
<template #header>
|
<template #header style="padding-bottom: 0">
|
||||||
在线预览
|
在线预览: {{currentGallery.name}} 页数:{{currentGallery.pages}}<br>
|
||||||
<div style="font-size: 3vh; display: inline" v-if="max > 0">
|
<div style="font-size: 3vh; display: inline" v-if="max > 0">
|
||||||
{{index + 1}} - {{(index) * lengthPerPage + 1}} ~ {{(index + 1) * lengthPerPage + 1 > currentLinks.length? currentLinks.length: (index + 1) * lengthPerPage + 1}}
|
{{ index + 1 }} - {{ (index) * lengthPerPage + 1 }} ~
|
||||||
|
{{ (index + 1) * lengthPerPage + 1 > currentGallery.images.length ? currentGallery.images.length : (index + 1) * lengthPerPage }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-scrollbar height="75vh" ref="onlineReadingScrollbar">
|
<el-scrollbar height="75vh" ref="onlineReadingScrollbar">
|
||||||
<el-image v-for="(link, i) in links" :src="link" :style="{'width': store.state.imageWidth, 'padding-right': store.state.imagePadding, 'background-color': 'gary'}"
|
<el-image v-for="(link, i) in links" :src="link" :style="{'width': store.state.imageWidth, 'padding-right': store.state.imagePadding, 'background-color': 'gary'}"
|
||||||
:preview-src-list="currentLinks" :initial-index="index * lengthPerPage + i" loading="lazy"/>
|
:preview-src-list="currentGallery.images" :initial-index="index * lengthPerPage + i" loading="lazy"/>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
|
||||||
<!-- 十页以下-->
|
<!-- 十页以下-->
|
||||||
@ -71,7 +72,7 @@ function closeDialog(){
|
|||||||
1 <
|
1 <
|
||||||
<el-input-number v-model="temp_index" :min="1" :max="max"/>
|
<el-input-number v-model="temp_index" :min="1" :max="max"/>
|
||||||
< {{max}}
|
< {{max}}
|
||||||
<el-button @click="jump(index + 1)" :disabled="index === max - 1">下一页</el-button><br>
|
<el-button @click="jump(index + 1)" :disabled="index === max - 1">下一页</el-button>
|
||||||
<el-button @click="jump(temp_index - 1)" size="large">跳转</el-button>
|
<el-button @click="jump(temp_index - 1)" size="large">跳转</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
:empty-text="emptyText"
|
:empty-text="emptyText"
|
||||||
:row-key="gallery=>gallery.gid"
|
:row-key="gallery=>gallery.gid"
|
||||||
class="table"
|
class="table"
|
||||||
|
@cellMouseEnter="showThumbnail"
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
@ -31,9 +32,7 @@
|
|||||||
|
|
||||||
<el-table-column label="名字" width="300vw">
|
<el-table-column label="名字" width="300vw">
|
||||||
<template #default="scoped">
|
<template #default="scoped">
|
||||||
<span @mouseover="showThumbnail(scoped.row)">
|
{{galleryNameType === 'shortName' ? scoped.row.shortName: scoped.row.name}}
|
||||||
{{galleryNameType === 'shortName' ? scoped.row.shortName: scoped.row.name}}
|
|
||||||
</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -42,7 +41,7 @@
|
|||||||
<span>
|
<span>
|
||||||
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
|
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
|
||||||
<el-button @click="changeGalleryCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
<el-button @click="changeGalleryCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
|
||||||
<el-button @click="onlineGalleryReader(scoped.row.gid)" :disabled="scoped.row.download === undefined">在线看</el-button>
|
<el-button @click="onlineGalleryReader(scoped.row)" :disabled="scoped.row.download === undefined">在线看</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -111,7 +110,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<OnlineReader :currentLinks="currentLinks" :isOnlineReading="isOnlineReading"/>
|
<OnlineReader :current-gallery="currentGallery" :isOnlineReading="isOnlineReading"/>
|
||||||
|
|
||||||
<span v-show="!loadComplete" class="side">请输入授权码后再查看</span>
|
<span v-show="!loadComplete" class="side">请输入授权码后再查看</span>
|
||||||
</div>
|
</div>
|
||||||
@ -124,12 +123,16 @@ import axios from "axios";
|
|||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import OnlineReader from "./OnlineReader.vue";
|
import OnlineReader from "./OnlineReader.vue";
|
||||||
|
|
||||||
|
let link = "https://downloader.lionwebsite.xyz/GalleryManage/"
|
||||||
|
|
||||||
//输入
|
//输入
|
||||||
let inputNode = ref(null)
|
let inputNode = ref(null)
|
||||||
//是否正在编辑页数
|
//是否正在编辑页数
|
||||||
let isEditingPage = ref(false)
|
let isEditingPage = ref(false)
|
||||||
//是否正在编辑标签
|
//是否正在编辑标签
|
||||||
let isEditingTag = ref(false)
|
let isEditingTag = ref(false)
|
||||||
|
//是否预览本子
|
||||||
|
let isOnlineReading = ref(false)
|
||||||
|
|
||||||
//临时变量
|
//临时变量
|
||||||
let galleryForTag = ref({})
|
let galleryForTag = ref({})
|
||||||
@ -151,9 +154,6 @@ let loadComplete = computed(() => {
|
|||||||
let currentTasks = computed(() => {
|
let currentTasks = computed(() => {
|
||||||
return store.getters.currentTasks ? store.getters.currentTasks: null
|
return store.getters.currentTasks ? store.getters.currentTasks: null
|
||||||
})
|
})
|
||||||
let isOnlineReading = computed(() => {
|
|
||||||
return store.state.isOnlineReading
|
|
||||||
})
|
|
||||||
|
|
||||||
let min = computed(() => {
|
let min = computed(() => {
|
||||||
return store.getters.min
|
return store.getters.min
|
||||||
@ -177,9 +177,7 @@ let emptyText = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//在线预览相关
|
//在线预览相关
|
||||||
let currentLinks = computed(() => {
|
let currentGallery = ref({name:"name"})
|
||||||
return store.state.currentLinks
|
|
||||||
})
|
|
||||||
let imageWidth = computed(() => {
|
let imageWidth = computed(() => {
|
||||||
return store.state.imageWidth
|
return store.state.imageWidth
|
||||||
})
|
})
|
||||||
@ -309,8 +307,9 @@ function updateGallery(link){
|
|||||||
function deleteGallery(gid){
|
function deleteGallery(gid){
|
||||||
store.dispatch("deleteGallery", gid)
|
store.dispatch("deleteGallery", gid)
|
||||||
}
|
}
|
||||||
function onlineGalleryReader(gid){
|
function onlineGalleryReader(gallery){
|
||||||
store.dispatch("queryOnlineLinks", gid)
|
currentGallery.value = gallery
|
||||||
|
isOnlineReading.value = true;
|
||||||
}
|
}
|
||||||
function shareGallery(data){
|
function shareGallery(data){
|
||||||
const {gid, shortName} = data
|
const {gid, shortName} = data
|
||||||
@ -333,11 +332,12 @@ function shareGallery(data){
|
|||||||
|
|
||||||
//显示缩略图
|
//显示缩略图
|
||||||
function showThumbnail(gallery){
|
function showThumbnail(gallery){
|
||||||
if(gallery.download !== undefined && gallery.status === "下载完成")
|
if(gallery.status === "下载完成") {
|
||||||
clearTimeout(debounceTimer)
|
clearTimeout(debounceTimer)
|
||||||
debounceTimer = setTimeout(() => {
|
debounceTimer = setTimeout(() => {
|
||||||
store.commit("_changeThumbnailGallery", gallery)
|
store.commit("_changeThumbnailGallery", gallery)
|
||||||
}, 500)
|
}, 500)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -74,26 +74,6 @@ const actions = {
|
|||||||
ElMessage("查询失败")
|
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){
|
updateGallery(context, link){
|
||||||
axios.post(GalleryManageUrl + "/update", qs.stringify({AuthCode: state.AuthCode, link}))
|
axios.post(GalleryManageUrl + "/update", qs.stringify({AuthCode: state.AuthCode, link}))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@ -117,17 +97,6 @@ const actions = {
|
|||||||
context.dispatch("loadWeekUsedAmount").then()
|
context.dispatch("loadWeekUsedAmount").then()
|
||||||
context.dispatch("updateGalleryTasks", "all").then(() => confirmCurrentTask(context.state))
|
context.dispatch("updateGalleryTasks", "all").then(() => confirmCurrentTask(context.state))
|
||||||
|
|
||||||
//获取图片合适长度
|
|
||||||
// let screenWidth = window.screen.width * 0.9 - 40
|
|
||||||
// let width
|
|
||||||
// let i
|
|
||||||
// for(i=3; i>0; i--)
|
|
||||||
// if(screenWidth / i <= 350 || screenWidth / i >= 100){
|
|
||||||
// width = screenWidth / i
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// width = width - (width % 10)
|
|
||||||
//写死图片合适宽度
|
//写死图片合适宽度
|
||||||
state.imageWidth = 27 + 'vw'
|
state.imageWidth = 27 + 'vw'
|
||||||
state.imagePadding = 1 + 'vw'
|
state.imagePadding = 1 + 'vw'
|
||||||
@ -315,9 +284,12 @@ const mutations = {
|
|||||||
break;
|
break;
|
||||||
case "下载完成":
|
case "下载完成":
|
||||||
task.progress = "下载完成"
|
task.progress = "下载完成"
|
||||||
let tempLink
|
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name) + ".zip?AuthCode=" + state.AuthCode
|
||||||
tempLink = task.link.replace("element-plus.org", "exhentai.org").replace("element.org", "e-hentai.org")
|
let links = []
|
||||||
task.download = GalleryManageUrl + "/file/" + encodeURI(task.name.replace("#", "")) + "?link=" + tempLink + "&AuthCode=" + state.AuthCode
|
for(let i=1; i<=task.pages; i++)
|
||||||
|
links.push(GalleryManageUrl + "/onlineImage/" + i + "?gid=" + task.gid);
|
||||||
|
|
||||||
|
task.images = links
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +330,7 @@ const mutations = {
|
|||||||
preDeleteIndex = -1
|
preDeleteIndex = -1
|
||||||
if(task.status !== "下载完成")
|
if(task.status !== "下载完成")
|
||||||
for(let i=0; i < tasks.length; i++)
|
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
|
preDeleteIndex = i
|
||||||
task.status = tasks[i].status
|
task.status = tasks[i].status
|
||||||
task.proceeding = tasks[i].proceeding
|
task.proceeding = tasks[i].proceeding
|
||||||
@ -574,30 +546,9 @@ const mutations = {
|
|||||||
else
|
else
|
||||||
state.length = state.defaultLength
|
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
|
|
||||||
},
|
|
||||||
_changeThumbnailGallery(state, gallery){
|
_changeThumbnailGallery(state, gallery){
|
||||||
state.thumbnailGallery = 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,10 +561,7 @@ const state = {
|
|||||||
tags: new Map(), //可用tag
|
tags: new Map(), //可用tag
|
||||||
isSearch: false, //用于决定是否显示搜索结果
|
isSearch: false, //用于决定是否显示搜索结果
|
||||||
|
|
||||||
onlineLinks: {}, //在线本子链接
|
|
||||||
isOnlineReading: false, //是否在线看
|
|
||||||
currentGid: "", //当前GID
|
currentGid: "", //当前GID
|
||||||
currentLinks: [], //当前本子链接
|
|
||||||
imageWidth: "", //图片宽度
|
imageWidth: "", //图片宽度
|
||||||
imagePadding: "", //图片padding
|
imagePadding: "", //图片padding
|
||||||
lengthPerPage: 0, //在线预览每页图片数量
|
lengthPerPage: 0, //在线预览每页图片数量
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user