win系统适配完成

This commit is contained in:
PineWin
2026-05-30 15:39:42 +08:00
parent b8debfcd46
commit 304f4b54ff
67 changed files with 323 additions and 111 deletions
+1 -1
View File
@@ -128,7 +128,6 @@ def save_cfg_to_file(cfg: dict) -> None:
- API Keys + 品牌信息 → .streamlit/secrets.toml
"""
import tomllib
import tomli_w # type: ignore
# ── 1. 非敏感配置 → config.json ──
config_path = Path(__file__).with_name("config.json")
@@ -203,6 +202,7 @@ def save_cfg_to_file(cfg: dict) -> None:
new_app_config["temperature"] = cfg["temperature"]
# 写出 TOML
import tomli_w
secrets_path.parent.mkdir(parents=True, exist_ok=True)
with secrets_path.open("wb") as f:
content = {"api_keys": new_api_keys, "app_config": new_app_config}