监听新增插件时校验,防止载入插件子级目录(如model)下插件

This commit is contained in:
Nwflower 2022-12-17 13:13:06 +08:00
parent 406e88bb19
commit 52770a7c58

View File

@ -773,6 +773,7 @@ class PluginsLoader {
watcher.on('add', async PluPath => {
let appName = path.basename(PluPath)
if (!appName.endsWith('.js')) return
if (!fs.existsSync(`${this.dir}/${dirName}/${appName}`)) return
let key = `${dirName}/${appName}`