修复#1614 正确解析多级目录的脚本路径 (#1616)

This commit is contained in:
景大侠 2022-09-06 13:25:12 +08:00 committed by GitHub
parent f7b6237355
commit 8d24949202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,9 +153,13 @@ const CronDetailModal = ({
cmd[1] = cmd[1].replace('/ql/data/scripts/', '');
}
let [p, s] = cmd[1].split('/');
if (!s) {
s = p;
let p: string, s: string;
let index = cmd[1].lastIndexOf('/');
if (index >= 0) {
s = cmd[1].slice(index + 1);
p = cmd[1].slice(0, index);
} else {
s = cmd[1];
p = '';
}
setScriptInfo({ parent: p, filename: s });