|
|
@ -55,21 +55,11 @@ function yiji() { |
|
|
|
let json = JSON.parse(gethtml(alistapi.server + "/api/fs/list", "", alistapi.password)); |
|
|
|
let json = JSON.parse(gethtml(alistapi.server + "/api/fs/list", "", 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 => { |
|
|
|
d = d.concat(arrayAdd(dirlist,1,alistapi)); |
|
|
|
d.push({ |
|
|
|
|
|
|
|
title: item.name, |
|
|
|
|
|
|
|
img: item.thumb || "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg", |
|
|
|
|
|
|
|
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 filelist = getlist(json.data.content,0); |
|
|
|
let filelist = getlist(json.data.content,0); |
|
|
|
|
|
|
|
d = d.concat(arrayAdd(filelist,0,alistapi)); |
|
|
|
|
|
|
|
/* |
|
|
|
filelist.forEach(item => { |
|
|
|
filelist.forEach(item => { |
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
|
title: item.name, |
|
|
|
title: item.name, |
|
|
@ -84,18 +74,60 @@ function yiji() { |
|
|
|
}, alistapi.server+"/api/fs/get", "/"+item.name, alistapi.password), |
|
|
|
}, alistapi.server+"/api/fs/get", "/"+item.name, alistapi.password), |
|
|
|
col_type: 'avatar', |
|
|
|
col_type: 'avatar', |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
})*/ |
|
|
|
} |
|
|
|
} |
|
|
|
}catch(e){ } |
|
|
|
}catch(e){ } |
|
|
|
} |
|
|
|
} |
|
|
|
setResult(d); |
|
|
|
setResult(d); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function arrayAdd(list,isdir,alistapi){ |
|
|
|
|
|
|
|
let d = []; |
|
|
|
|
|
|
|
if(isdir){ |
|
|
|
|
|
|
|
list.forEach(item => { |
|
|
|
|
|
|
|
d.push({ |
|
|
|
|
|
|
|
title: item.name, |
|
|
|
|
|
|
|
img: item.thumb || "https://gitcode.net/qq_32394351/dr/-/raw/master/img/文件类型/文件夹.svg", |
|
|
|
|
|
|
|
url: $("hiker://empty#noRecordHistory##noHistory#").rule((api) => { |
|
|
|
|
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); |
|
|
|
|
|
|
|
Alistlist(api); |
|
|
|
|
|
|
|
},alistapi), |
|
|
|
|
|
|
|
col_type: 'avatar', |
|
|
|
|
|
|
|
extra: { |
|
|
|
|
|
|
|
path: (MY_PARAMS.path||"") + "/" + item.name |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
list.forEach(item => { |
|
|
|
|
|
|
|
d.push({ |
|
|
|
|
|
|
|
title: item.name, |
|
|
|
|
|
|
|
img: item.thumb || "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg@Referer=", |
|
|
|
|
|
|
|
url: $().lazyRule((apiurl,path,password) => { |
|
|
|
|
|
|
|
require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); |
|
|
|
|
|
|
|
let json = JSON.parse(gethtml(apiurl, path, password)); |
|
|
|
|
|
|
|
log(json.data.raw_url); |
|
|
|
|
|
|
|
if(json.code==200){ |
|
|
|
|
|
|
|
return json.data.raw_url; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return "hiker://empty"; |
|
|
|
|
|
|
|
}, alistapi.server + "/api/fs/get", (MY_PARAMS.path||"") + "/" + item.name, alistapi.password), |
|
|
|
|
|
|
|
col_type: 'avatar', |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return d; |
|
|
|
|
|
|
|
} |
|
|
|
function Alistlist(alistapi){ |
|
|
|
function Alistlist(alistapi){ |
|
|
|
let d = []; |
|
|
|
let d = []; |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let json = JSON.parse(gethtml(alistapi.server + "/api/fs/list", MY_PARAMS.path, alistapi.password)); |
|
|
|
let json = JSON.parse(gethtml(alistapi.server + "/api/fs/list", MY_PARAMS.path, alistapi.password)); |
|
|
|
if(json.code==200){ |
|
|
|
if(json.code==200){ |
|
|
|
|
|
|
|
let dirlist = getlist(json.data.content,1); |
|
|
|
|
|
|
|
d = d.concat(arrayAdd(dirlist,1,alistapi)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let filelist = getlist(json.data.content,0); |
|
|
|
|
|
|
|
d = d.concat(arrayAdd(filelist,0,alistapi)); |
|
|
|
|
|
|
|
/* |
|
|
|
let dirlist = getlist(json.data.content,1); |
|
|
|
let dirlist = getlist(json.data.content,1); |
|
|
|
dirlist.forEach(item => { |
|
|
|
dirlist.forEach(item => { |
|
|
|
d.push({ |
|
|
|
d.push({ |
|
|
@ -128,6 +160,7 @@ function Alistlist(alistapi){ |
|
|
|
col_type: 'avatar', |
|
|
|
col_type: 'avatar', |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
*/ |
|
|
|
} |
|
|
|
} |
|
|
|
}catch(e){ } |
|
|
|
}catch(e){ } |
|
|
|
setResult(d); |
|
|
|
setResult(d); |
|
|
|