From 3dc8fd4f5c538a6b519bf3e953765796e318b41b Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sun, 12 Feb 2023 15:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyAlist.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyAlist.js | 58 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 09bfd1cc..dd7d86e5 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -43,7 +43,7 @@ function yiji() { d.push({ title: item.name, url: $('#noLoading#').lazyRule((item) => { - putMyVar('Alistapi', item.server); + storage0.putMyVar('Alistapi', item); refreshPage(false); return "hiker://empty"; }, item), @@ -51,23 +51,28 @@ function yiji() { }) }) if (datalist.length > 0) { - let listapi = getMyVar('Alistapi', datalist[0].server) + "/api/fs/list"; + let alistapi = storage0.getMyVar('Alistapi', datalist[0]); + let apiurl = alistapi.server + "/api/fs/list"; try{ - let json = JSON.parse(gethtml(listapi,"","")); + let json = JSON.parse(gethtml(apiurl,"",alistapi.password)); if(json.code==200){ let dirlist = getlist(json.data.content,1); dirlist.forEach(item => { d.push({ title: item.name, img: "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg", - url: $('#noLoading#').lazyRule(() => { - return "hiker://empty"; - }), + url: $("hiker://empty#noRecordHistory##noHistory#").rule((api) => { + require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); + Alistlist(api); + },alistapi), col_type: 'avatar', + extra: { + path: "/"+item.name + } }) }) - let vodlist = getlist(json.data.content,0); - vodlist.forEach(item => { + let filelist = getlist(json.data.content,0); + filelist.forEach(item => { d.push({ title: item.name, img: "", @@ -81,4 +86,41 @@ function yiji() { }catch(e){ } } setResult(d); +} + +function Alistlist(alistapi){ + let d = []; + let apiurl = alistapi.server + "/api/fs/list"; + try{ + let json = JSON.parse(gethtml(apiurl,MY_PARAMS.path,alistapi.password)); + if(json.code==200){ + let dirlist = getlist(json.data.content,1); + dirlist.forEach(item => { + d.push({ + title: item.name, + img: "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg", + url: $("hiker://empty#noRecordHistory##noHistory#").rule((item) => { + require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); + Alistlist(api,item); + },item,api), + col_type: 'avatar', + extra: { + path: MY_PARAMS.path+"/"+item.name + } + }) + }) + let filelist = getlist(json.data.content,0); + filelist.forEach(item => { + d.push({ + title: item.name, + img: "", + url: $('#noLoading#').lazyRule(() => { + return "hiker://empty"; + }), + col_type: 'avatar', + }) + }) + } + }catch(e){ } + setResult(d); } \ No newline at end of file