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; }