在线预览
查看封面图
删除
@@ -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