refactor: centralize account cleanup in API routes and refine login checkbox styling.

This commit is contained in:
CJACK
2026-02-13 22:30:55 +08:00
parent d0b159fb8a
commit ee0b7f08a0
3 changed files with 4 additions and 5 deletions

View File

@@ -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(),

View File

@@ -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(),

View File

@@ -87,8 +87,8 @@ export default function Login({ onLogin, onMessage }) {
checked={remember}
onChange={e => setRemember(e.target.checked)}
/>
<div className="w-4.5 h-4.5 bg-secondary border border-border rounded-md peer-checked:bg-primary peer-checked:border-primary transition-all shadow-sm"></div>
<Check className="absolute w-3 h-3 text-primary-foreground opacity-0 peer-checked:opacity-100 left-0.5 transition-opacity" />
<div className="w-[18px] h-[18px] bg-secondary border border-border rounded-md peer-checked:bg-primary peer-checked:border-primary transition-all shadow-sm"></div>
<Check className="absolute inset-0 m-auto w-3 h-3 text-primary-foreground opacity-0 peer-checked:opacity-100 transition-opacity stroke-[3]" />
</div>
<span className="text-xs font-medium text-muted-foreground group-hover:text-foreground transition-colors">{t('login.rememberSession')}</span>
</label>