fix(config): 强制指定 quote_mode ,避免后续依赖升级,默认值不再是 always

This commit is contained in:
Aqr-K
2025-05-25 18:30:00 +08:00
parent 3abb2c8674
commit 99621cfd66

View File

@@ -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