From 54534accf0c5ac754d8e794dbaa747ccc0837254 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sat, 18 Feb 2023 14:22:04 +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 | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/SrcJyAlist.js b/SrcJyAlist.js index 41ca47e5..b845e4cd 100644 --- a/SrcJyAlist.js +++ b/SrcJyAlist.js @@ -169,40 +169,37 @@ function alistList(alistapi){ function arrayAdd(list,isdir,alistapi){ let d = []; - if(isdir){ - list.forEach(item => { - let folderpath = (item.parent||MY_PARAMS.path||"") + "/" + item.name; + list.forEach(item => { + let path = ((item.parent=="/"?"":item.parent)||MY_PARAMS.path||"") + "/" + item.name; + if(isdir){ d.push({ title: item.name, img: item.thumb || config.依赖.match(/http(s)?:\/\/.*\//)[0] + "img/文件夹.svg", - url: $("hiker://empty##" + alistapi.server + folderpath + "#noRecordHistory##noHistory#").rule((alistapi) => { + url: $("hiker://empty##" + alistapi.server + path + "#noRecordHistory##noHistory#").rule((alistapi) => { require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); alistList(alistapi); },alistapi), col_type: 'avatar', extra: { - path: folderpath, + path: path, cls: "alist" } }) - }) - }else{ - list.forEach(item => { - let filepath = (item.parent||MY_PARAMS.path||"") + "/" + item.name; + }else{ d.push({ title: item.name, img: item.thumb || "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg@Referer=", - url: $(alistapi.server+filepath).lazyRule((api,path,pwd,sign) => { + url: $(alistapi.server+path).lazyRule((api,path,pwd,sign) => { require(config.依赖.match(/http(s)?:\/\/.*\//)[0] + 'SrcJyAlist.js'); return alistUrl(api,path,pwd,sign); - }, alistapi.server, filepath, alistapi.password, item.sign), + }, alistapi.server, path, alistapi.password, item.sign), col_type: 'avatar', extra: { cls: "alist" } }) - }) - } + } + }) return d; }