From ee4af7d06bb596397cba8231edb30b8b6bd4332b Mon Sep 17 00:00:00 2001 From: willow-yang <66243023+willow-yang@users.noreply.github.com> Date: Mon, 2 Jun 2025 23:12:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=88=B7=E6=96=B0cookie=E9=97=AE=E9=A2=98=20#103=20(#104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: willow --- .gitignore | 1 + common/config.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 2c74f48..d8e3208 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ config.yml # VSCode .history +.idea # Vim *.swp diff --git a/common/config.py b/common/config.py index 238f59c..c5c002b 100644 --- a/common/config.py +++ b/common/config.py @@ -283,12 +283,18 @@ def write_config(key, value): keys = key.split(".") current = config + current_cache = variable.config for k in keys[:-1]: if k not in current: current[k] = {} current = current[k] + if k not in current_cache: + current_cache[k] = {} + current_cache = current_cache[k] current[keys[-1]] = value + # 更新配置缓存 + current_cache[keys[-1]] = value # 设置保留注释和空行的参数 y = yaml_.YAML()