From e7cd30b30d0335b3949c173c6a92c34478d0bafe Mon Sep 17 00:00:00 2001 From: fish Date: Mon, 6 Jul 2026 15:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20admin=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit admin 用户可在侧边栏底部进入用户管理页, 支持新增/删除用户。 Co-Authored-By: Claude --- serve/frontend/src/components/Layout.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/serve/frontend/src/components/Layout.tsx b/serve/frontend/src/components/Layout.tsx index 41edf3a..663daaf 100644 --- a/serve/frontend/src/components/Layout.tsx +++ b/serve/frontend/src/components/Layout.tsx @@ -28,6 +28,8 @@ import { Moon, Sun, User, + Users, + Shield, LogOut, } from 'lucide-react' import { Logo } from './Logo' @@ -92,6 +94,7 @@ export function Layout() { }) const username = authData?.username + const role = authData?.role const navigate = useNavigate() const qc = useQueryClient() const [darkMode, setDarkMode] = useState(() => { @@ -209,6 +212,21 @@ export function Layout() { )} + {/* 用户管理 (admin only) */} + {role === 'admin' && ( + + 'flex items-center gap-2 px-3 py-1.5 text-xs text-foreground/70 hover:bg-elevated hover:text-foreground transition-colors' + + (isActive ? ' bg-accent/10 text-accent' : '') + } + > + + + 用户管理 + + )} + {/* 暗夜模式 */}