diff --git a/plugin_common/plugin_manager.py b/plugin_common/plugin_manager.py index 26786c4..e04caaa 100644 --- a/plugin_common/plugin_manager.py +++ b/plugin_common/plugin_manager.py @@ -300,11 +300,11 @@ class PluginManager: self.LOG.error(f"PluginManager:插件模块 {module_name} 加载配置失败") return None - # 添加检查enable状态的代码 - plugin_config = plugin._config.get(plugin.__class__.__name__, {}) - if not plugin_config.get("enable", True): # 默认为True,如果没有配置 - self.LOG.info(f"PluginManager:插件 {module_name} 已禁用,跳过加载") - return None + # 修改检查enable状态的代码:遍历所有配置节点 + for section in plugin._config.values(): + if isinstance(section, dict) and not section.get("enable", True): + self.LOG.info(f"PluginManager:插件 {module_name} 已禁用,跳过加载") + return None # 初始化插件 if not plugin.initialize(self.system_context):