韵达音频授权提示弹窗清理(含重试重载后)+ 服务模式读取 debug 配置

- site_yunda:抽 dismiss_audio_prompt 助手(点「确定」);yunda_reset 重载主页后调用(解决重试重载后弹窗复现)
- runtime:_dismiss_initial_popups 韵达分支改用 dismiss_audio_prompt;launch_and_prepare 自己读 config.yaml 的 debug 段(服务模式也生效,之前仅 main_router 传参)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-07-18 10:54:10 +08:00
parent 6d45a9f5e5
commit ed6d403451
2 changed files with 35 additions and 2 deletions

View File

@@ -242,7 +242,17 @@ def launch_and_prepare(debug_mode=False, debug_target=""):
state_store.init_db()
seed_legacy_config()
# 1. 安能 Electron 应用路径state.db前端站点配置;seed 已灌入)
# 1. 读 debug 配置config.yaml服务模式也生效+ 安能路径state.dbseed 已灌入)
if os.path.exists(CONFIG_PATH):
try:
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
_cfg = yaml.safe_load(f) or {}
_dbg = _cfg.get("debug", {}) or {}
if _dbg.get("enabled"):
debug_mode = True
debug_target = str(_dbg.get("target_site", "") or "")
except Exception as e:
print(f"⚠️ 读取 config.yaml(debug) 失败: {e}")
anneng_app_path = state_store.get_setting("安能", "app_path")
# 2. 确定要挂载的网页站点 + 安能标记
@@ -366,7 +376,7 @@ def launch_and_prepare(debug_mode=False, debug_target=""):
def _dismiss_initial_popups(pages_map):
"""顺心 / 百世 初始弹窗清理。"""
"""顺心 / 百世 / 韵达 初始弹窗清理。"""
if "顺心" in pages_map:
for acct, sx_page in enumerate(pages_map["顺心"], start=1):
try:
@@ -410,6 +420,14 @@ def _dismiss_initial_popups(pages_map):
print(" ✅ 【百世】初始弹窗处理完成。")
except Exception:
pass
if "韵达" in pages_map:
try:
yd_page = pages_map["韵达"]
yd_page.bring_to_front()
print(">> 正在检查【韵达】音频设备授权提示...")
site_yunda.dismiss_audio_prompt(yd_page)
except Exception:
pass
# ============================ 任务派发 ============================