mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-07 18:05:30 +08:00
refactor: centralize account cleanup in API routes and refine login checkbox styling.
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user