From ee0b7f08a07687a53004b636e858a7759a63de97 Mon Sep 17 00:00:00 2001 From: CJACK Date: Fri, 13 Feb 2026 22:30:55 +0800 Subject: [PATCH] refactor: centralize account cleanup in API routes and refine login checkbox styling. --- routes/claude.py | 2 +- routes/openai.py | 3 +-- webui/src/components/Login.jsx | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/routes/claude.py b/routes/claude.py index 706c022..e9c7b25 100644 --- a/routes/claude.py +++ b/routes/claude.py @@ -314,7 +314,7 @@ Remember: Output ONLY the JSON, no other text. The response must start with {{ a deepseek_resp.close() except Exception: pass - cleanup_account(request) + # 注意:不在此处调用 cleanup_account,由外层 finally 统一处理 return StreamingResponse( claude_sse_stream(), diff --git a/routes/openai.py b/routes/openai.py index 5ba60f2..f79283f 100644 --- a/routes/openai.py +++ b/routes/openai.py @@ -435,8 +435,7 @@ IMPORTANT: If calling tools, output ONLY the JSON. The response must start with except Exception as e: logger.error(f"[sse_stream] 异常: {e}") - finally: - cleanup_account(request) + # 注意:不在此处调用 cleanup_account,由外层 finally 统一处理 return StreamingResponse( sse_stream(), diff --git a/webui/src/components/Login.jsx b/webui/src/components/Login.jsx index 2ebe5d6..c06c12e 100644 --- a/webui/src/components/Login.jsx +++ b/webui/src/components/Login.jsx @@ -87,8 +87,8 @@ export default function Login({ onLogin, onMessage }) { checked={remember} onChange={e => setRemember(e.target.checked)} /> -
- +
+ {t('login.rememberSession')}