"""临时校验:人工登录是否使用按账号隔离的浏览器用户目录(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)) config.set_debug(True) print("profile 根目录:", config.BROWSER_PROFILE_ROOT) print("账号A 目录:", config.get_profile_dir("***REMOVED***")) print("账号B 目录:", config.get_profile_dir("***REMOVED***")) result = tianque_browser.manual_login("***REMOVED***", "***REMOVED***", wait_seconds=6) print("结果:", result.get("success"), result.get("message")) print("临时公共目录是否被使用:", os.path.join(os.environ.get("TEMP", ""), "DrissionPage", "userData"))