From 86970b16626790724cb5473de1b95212976a2491 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Mon, 16 Dec 2024 14:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyPublic.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/SrcJyPublic.js b/SrcJyPublic.js index 28e47946..02b007e1 100644 --- a/SrcJyPublic.js +++ b/SrcJyPublic.js @@ -516,11 +516,16 @@ function clearJkSort() { // 读取目录路径下文件输入数组 function readDir(path) { let names = []; - let file = new java.io.File(path.replace("file://", "")); + if(path){ + if(path.startsWith('hiker://')){ + path = getPath(path); + } + let file = new java.io.File(path.replace("file://", "")); - if (!(file.exists() && file.isDirectory())) return names; - for (let it of file.listFiles()) { - names.push(String(it.getName())); + if (!(file.exists() && file.isDirectory())) return names; + for (let it of file.listFiles()) { + names.push(String(it.getName())); + } } return names; }