feat(backend): replace Selenium with Playwright

BREAKING CHANGE: backend now requires Python 3.12 or newer.
This commit is contained in:
2026-05-04 21:20:30 +08:00
parent fa07b340e7
commit d811c20932
15 changed files with 451 additions and 1570 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ class AuthService:
# 老用户:刷新 Token
logger.info(f"老用户 {alias} 请求刷新 Token,会话: {session_id}")
# 在后台线程启动 Selenium,传入 jwt_sub
# 在后台线程启动 Playwright,传入 jwt_sub
thread = threading.Thread(
target=get_token_headless,
args=(session_id, existing_user.jwt_sub, alias, client_ip),
@@ -69,7 +69,7 @@ class AuthService:
logger.info(f"新用户 {alias} 请求注册,会话: {session_id},已预占用户名")
# 在后台线程启动 Selenium,不传入 jwt_sub(新用户)
# 在后台线程启动 Playwright,不传入 jwt_sub(新用户)
thread = threading.Thread(
target=get_token_headless, args=(session_id, None, alias, client_ip), daemon=True
)
+1 -1
View File
@@ -287,7 +287,7 @@ class CheckInService:
}
# 执行打卡(传递 task 对象和用户 token)
logger.info(f"🤖 调用 Selenium Worker 执行打卡...")
logger.info(f"🤖 调用 Playwright Worker 执行打卡...")
result = perform_check_in(task, user.authorization)
# 如果是 Token 过期导致的失败,处理 Token 过期情况