更新 'SrcJyAlist.js'

master
src48597962 2 years ago
parent 567e9bc94f
commit 3dc8fd4f5c
  1. 58
      SrcJyAlist.js

@ -43,7 +43,7 @@ function yiji() {
d.push({ d.push({
title: item.name, title: item.name,
url: $('#noLoading#').lazyRule((item) => { url: $('#noLoading#').lazyRule((item) => {
putMyVar('Alistapi', item.server); storage0.putMyVar('Alistapi', item);
refreshPage(false); refreshPage(false);
return "hiker://empty"; return "hiker://empty";
}, item), }, item),
@ -51,23 +51,28 @@ function yiji() {
}) })
}) })
if (datalist.length > 0) { 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{ try{
let json = JSON.parse(gethtml(listapi,"","")); let json = JSON.parse(gethtml(apiurl,"",alistapi.password));
if(json.code==200){ if(json.code==200){
let dirlist = getlist(json.data.content,1); let dirlist = getlist(json.data.content,1);
dirlist.forEach(item => { dirlist.forEach(item => {
d.push({ d.push({
title: item.name, title: item.name,
img: "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg", img: "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg",
url: $('#noLoading#').lazyRule(() => { url: $("hiker://empty#noRecordHistory##noHistory#").rule((api) => {
return "hiker://empty"; require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js');
}), Alistlist(api);
},alistapi),
col_type: 'avatar', col_type: 'avatar',
extra: {
path: "/"+item.name
}
}) })
}) })
let vodlist = getlist(json.data.content,0); let filelist = getlist(json.data.content,0);
vodlist.forEach(item => { filelist.forEach(item => {
d.push({ d.push({
title: item.name, title: item.name,
img: "", img: "",
@ -81,4 +86,41 @@ function yiji() {
}catch(e){ } }catch(e){ }
} }
setResult(d); 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);
} }
Loading…
Cancel
Save