From b790a79f98232eef7c61e2850c1fa70f0666f77b Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Sat, 15 Jun 2024 11:56:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/plugins.loader.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/plugins.loader.ts b/src/core/plugins.loader.ts index 82a5693..967b6d4 100644 --- a/src/core/plugins.loader.ts +++ b/src/core/plugins.loader.ts @@ -340,8 +340,6 @@ class PluginsLoader { * */ for (const plugin of priority) { - console.log('plugin', plugin.add) - /** * 上下文hook */ @@ -354,7 +352,7 @@ class PluginsLoader { let ret for (const fnc in context) { // 不是函数,错误插件错误写法 - if (!plugin[fnc]) { + if (typeof plugin[fnc] !== 'function') { continue } ret ||= await plugin[fnc](context[fnc]) @@ -416,7 +414,7 @@ class PluginsLoader { try { const start = Date.now() // 不是函数。 - if (!plugin[v.fnc]) { + if (typeof plugin[v.fnc] !== 'function') { continue } const res = await plugin[v.fnc](e)