Commit 219f7440 by luoqi

feat(web): 工作台头部加退出登录(配合模拟登录)

头像旁加 LogOut 按钮 → useAuthStore.clear() 清 token → AuthGate 自动弹回登录对话框。
口径与登录一致(mock/SSO 都走 AuthGate);clear() 已存在,纯前端。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent a3b60813
......@@ -9,6 +9,7 @@ import {
ChevronRight,
Flame,
ListChecks,
LogOut,
RefreshCw,
Search,
Waves,
......@@ -367,6 +368,19 @@ function PageHeader({
<span className="inline-flex h-8 w-8 items-center justify-center rounded-full bg-gradient-to-br from-teal-400 to-teal-600 text-[12px] font-bold text-white">
{userDisplayName(user).charAt(0).toUpperCase()}
</span>
<Button
variant="ghost"
size="icon"
className="h-8 w-8 text-slate-400 hover:text-rose-600"
title="退出登录"
aria-label="退出登录"
onClick={() => {
useAuthStore.getState().clear(); // 清 token → AuthGate 自动弹回登录(mock/SSO 同此口径)
toast.success('已退出登录');
}}
>
<LogOut className="h-4 w-4" />
</Button>
</div>
</header>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment