fix: 并发确认已保存账号,写回前重新读取再合并

This commit is contained in:
2026-10-25 07:11:52 +08:00
parent 0f49e500e3
commit f64d28bc26
4 changed files with 94 additions and 34 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import uuid
from fastapi import APIRouter, HTTPException
from app.platform.client import NqiError, needs_captcha
from app.platform.sessions import available_accounts, remember, resume
from app.platform.sessions import available_accounts, remember_account, resume
from app.shared.state import state
logger = logging.getLogger("nqi.auth")
@@ -129,7 +129,7 @@ async def login(body: dict) -> dict:
pass
raise HTTPException(status_code=400, detail=message) from exc
challenge.password = ""
remember(user, client.export_cookies())
await remember_account(user, client.export_cookies())
state.flows.pop(session_id, None)
if state.client is not None and state.client is not client:
await state.client.aclose()