fix: _save_cookies_file改用async版本 + 加eventlet支持WebSocket

- 密码登录保存cookie时用await _save_cookies_file_async替代同步版
- 加eventlet依赖解决WebSocket 500错误
This commit is contained in:
2026-04-02 13:07:25 +08:00
parent 17fab8d14c
commit fa788bf3fc
2 changed files with 2 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
flask>=3.0 flask>=3.0
flask-socketio>=5.3 flask-socketio>=5.3
eventlet>=0.36
playwright==1.52.0 playwright==1.52.0
playwright-stealth>=1.0 playwright-stealth>=1.0
pyyaml>=6.0 pyyaml>=6.0

View File

@@ -146,7 +146,7 @@ async def login_with_password(account_id, phone, password):
# 保存 storage_state + 精简 cookies # 保存 storage_state + 精简 cookies
auth_path = get_auth_path(account_id) auth_path = get_auth_path(account_id)
await context.storage_state(path=auth_path) await context.storage_state(path=auth_path)
_save_cookies_file(account_id, context) await _save_cookies_file_async(context, account_id)
return True, "登录成功" return True, "登录成功"