mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-27 22:56:07 +08:00
过滤scripts目录下的子目录
This commit is contained in:
parent
640bd1d6e1
commit
a23afb19a0
|
@ -18,7 +18,11 @@ export default (app: Router) => {
|
||||||
const fileList = fs.readdirSync(config.scriptPath, 'utf-8');
|
const fileList = fs.readdirSync(config.scriptPath, 'utf-8');
|
||||||
res.send({
|
res.send({
|
||||||
code: 200,
|
code: 200,
|
||||||
data: fileList.map((x) => {
|
data: fileList
|
||||||
|
.filter((x) => {
|
||||||
|
return !fs.lstatSync(config.scriptPath + x).isDirectory();
|
||||||
|
})
|
||||||
|
.map((x) => {
|
||||||
return { title: x, value: x, key: x };
|
return { title: x, value: x, key: x };
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user