"""临时校验:xq0079 人工登录通道能否打开登录页并预填账号密码(8 秒后自动超时,用完即删)。""" import importlib.util import os import sys if hasattr(sys.stdout, "reconfigure"): sys.stdout.reconfigure(encoding="utf-8", errors="replace") REPO = r"d:\work\code\37duAutomation" sys.path.insert(0, os.path.join(REPO, "desktop", "electron-shell", "python")) PLUGIN_DIR = os.path.join(REPO, "plugins", "XQ0001-0100", "XQ0079 金色湖畔扫码数据导出") spec = importlib.util.spec_from_file_location( "xq0079", os.path.join(PLUGIN_DIR, "__init__.py"), submodule_search_locations=[PLUGIN_DIR]) mod = importlib.util.module_from_spec(spec) sys.modules["xq0079"] = mod spec.loader.exec_module(mod) from xq0079 import config # noqa: E402 from xq0079.data import tianque_browser # noqa: E402 config.set_log(lambda m, level="INFO": print(f"[{level}] {m}", flush=True)) print("登录选项:", config.LOGIN_MODE_CHOICES) result = tianque_browser.manual_login("***REMOVED***", "***REMOVED***", wait_seconds=8) print("结果:", result.get("success"), result.get("message"))