From 99621cfd66bcdf7abb71e1fe21c1a4ec44efb42e Mon Sep 17 00:00:00 2001 From: Aqr-K <95741669+Aqr-K@users.noreply.github.com> Date: Sun, 25 May 2025 18:30:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E5=BC=BA=E5=88=B6=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=20`quote=5Fmode`=20=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=8D=E5=86=8D=E6=98=AF=20`alway?= =?UTF-8?q?s`=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/core/config.py b/app/core/config.py index 41a3e8e8..cd4820dc 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -429,7 +429,8 @@ class Settings(BaseSettings, ConfigModel, LogConfigModel): else: value_to_write = str(converted_value) if converted_value is not None else "" - set_key(SystemUtils.get_env_path(), field.name, value_to_write) + set_key(dotenv_path=SystemUtils.get_env_path(), key_to_set=field.name, value_to_set=value_to_write, + quote_mode="always") if is_converted: logger.info(f"配置项 '{field.name}' 已自动修正并写入到 'app.env' 文件") return True, message