From fa788bf3fcec9110484a9fcec87ba1d7a373b5e8 Mon Sep 17 00:00:00 2001 From: Jeason <1710884619@qq.com> Date: Thu, 2 Apr 2026 13:07:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5Fsave=5Fcookies=5Ffile=E6=94=B9?= =?UTF-8?q?=E7=94=A8async=E7=89=88=E6=9C=AC=20+=20=E5=8A=A0eventlet?= =?UTF-8?q?=E6=94=AF=E6=8C=81WebSocket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 密码登录保存cookie时用await _save_cookies_file_async替代同步版 - 加eventlet依赖解决WebSocket 500错误 --- requirements.txt | 1 + server/services/auth_service.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fcfca27..15d5e7f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ flask>=3.0 flask-socketio>=5.3 +eventlet>=0.36 playwright==1.52.0 playwright-stealth>=1.0 pyyaml>=6.0 diff --git a/server/services/auth_service.py b/server/services/auth_service.py index 804a2d0..345c3e4 100644 --- a/server/services/auth_service.py +++ b/server/services/auth_service.py @@ -146,7 +146,7 @@ async def login_with_password(account_id, phone, password): # 保存 storage_state + 精简 cookies auth_path = get_auth_path(account_id) await context.storage_state(path=auth_path) - _save_cookies_file(account_id, context) + await _save_cookies_file_async(context, account_id) return True, "登录成功"