From ca96589af2aa1f0d2463fdd9ce1ec99f0cfee08e Mon Sep 17 00:00:00 2001 From: UCPr <2032385471@qq.com> Date: Tue, 19 Mar 2024 20:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4js=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8D=B8=E8=BD=BD=E4=B8=8D=E5=AE=8C=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugins/loader.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/plugins/loader.js b/lib/plugins/loader.js index 04d185d..96bc2bf 100644 --- a/lib/plugins/loader.js +++ b/lib/plugins/loader.js @@ -750,9 +750,12 @@ class PluginsLoader { logger.mark(`[卸载插件][${dirName}][${appName}]`) /** 停止更新监听 */ this.watcher[`${dirName}.${appName}`].removeAllListeners('change') - for (const i in this.priority) - if (this.priority[i].key == key) + // lodash.remove(this.priority, { key }) + for (let i = this.priority.length - 1; i >= 0; i--) { + if (this.priority[i].key === key) { this.priority.splice(i, 1) + } + } }) this.watcher[`${dirName}.${appName}`] = watcher }