From 6472e0caf0cdf676aa363b9e01132af6d693c3e7 Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Sat, 15 Jun 2024 11:54:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system | 2 +- src/core/plugins.loader.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/system b/plugins/system index 9fcf22c..4789717 160000 --- a/plugins/system +++ b/plugins/system @@ -1 +1 @@ -Subproject commit 9fcf22ccbec7cfef74d0846240395a4af622c9ff +Subproject commit 47897176e2805a092fb2c06ac6f3ca689d6818b0 diff --git a/src/core/plugins.loader.ts b/src/core/plugins.loader.ts index b702b70..82a5693 100644 --- a/src/core/plugins.loader.ts +++ b/src/core/plugins.loader.ts @@ -340,6 +340,8 @@ class PluginsLoader { * */ for (const plugin of priority) { + console.log('plugin', plugin.add) + /** * 上下文hook */ @@ -352,8 +354,7 @@ class PluginsLoader { let ret for (const fnc in context) { // 不是函数,错误插件错误写法 - if (typeof plugin[fnc] !== 'function') { - // logger.info(plugin, fnc, '不是函数') + if (!plugin[fnc]) { continue } ret ||= await plugin[fnc](context[fnc]) @@ -415,7 +416,7 @@ class PluginsLoader { try { const start = Date.now() // 不是函数。 - if (typeof plugin[v.fnv] !== 'function') { + if (!plugin[v.fnc]) { continue } const res = await plugin[v.fnc](e)