From a046560ddb3a3f92c7c19b92710b8d50bc7b00c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AE=E5=8F=AE=E5=BD=93?= <604054726@qq.com> Date: Fri, 1 Mar 2024 16:16:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=97=A7=E7=89=88=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=86=99=E5=85=A5app.env=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- plugins/configcenter/__init__.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b722f18..21e1714 100644 --- a/package.json +++ b/package.json @@ -290,7 +290,7 @@ "ConfigCenter": { "name": "配置中心", "description": "快速调整部分系统设定。", - "version": "2.1", + "version": "2.2", "icon": "setting.png", "author": "jxxghp", "level": 1 diff --git a/plugins/configcenter/__init__.py b/plugins/configcenter/__init__.py index 932da08..a1ca530 100644 --- a/plugins/configcenter/__init__.py +++ b/plugins/configcenter/__init__.py @@ -17,7 +17,7 @@ class ConfigCenter(_PluginBase): # 插件图标 plugin_icon = "setting.png" # 插件版本 - plugin_version = "2.1" + plugin_version = "2.2" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -85,18 +85,14 @@ class ConfigCenter(_PluginBase): # 自定义配置,以换行分隔 config_params = self.__parse_params(conf.get("params")) conf.update(config_params) - # 去掉无效参数 - try: - conf.pop("enabled") - conf.pop("writeenv") - conf.pop("params") - except KeyError: - pass # 读写app.env env_path = settings.CONFIG_PATH / "app.env" for key, value in conf.items(): if not key: continue + # 如果参数不在支持列表中, 则跳过 + if key not in self.settings_attributes and key not in config_params: + continue if value is None or str(value) == "None": value = '' else: