调整登录态默认存储到provider目录

This commit is contained in:
liuwei
2026-05-07 10:29:03 +08:00
parent d0acd33b66
commit c55053710a
13 changed files with 50 additions and 29 deletions

View File

@@ -205,7 +205,7 @@ class Config(object):
# wechat_ipad 配置归一化:
# 1. 静态连接参数现在统一走 config.yaml + .env而不是要求用户维护独立 TOML
# 2. 登录后的 wxid / device_id / device_name 会落到本地状态文件,因此这里保留 state_file 配置
# 2. 登录后的 wxid / device_id / device_name 会落到 provider 自己目录下的本地状态文件;
# 3. legacy_config_path 仅用于兼容历史仓库中的 `wechat_ipad/config.toml`,迁移完成后可逐步淡出。
wechat_ipad_config = dict(normalized.get("wechat_ipad", {}) or {})
wechat_ipad_config["server_port"] = self._safe_int(wechat_ipad_config.get("server_port", 8059), 8059)
@@ -217,9 +217,7 @@ class Config(object):
wechat_ipad_config["wxid"] = str(wechat_ipad_config.get("wxid", "") or "").strip()
wechat_ipad_config["device_name"] = str(wechat_ipad_config.get("device_name", "") or "").strip()
wechat_ipad_config["device_id"] = str(wechat_ipad_config.get("device_id", "") or "").strip()
wechat_ipad_config["state_file"] = str(
wechat_ipad_config.get("state_file", "temp/wechat_ipad/config.toml") or "temp/wechat_ipad/config.toml"
).strip()
wechat_ipad_config["state_file"] = str(wechat_ipad_config.get("state_file", "") or "").strip()
wechat_ipad_config["legacy_config_path"] = str(
wechat_ipad_config.get("legacy_config_path", "wechat_ipad/config.toml") or "wechat_ipad/config.toml"
).strip()