refactor(auth): 移除用户登出功能并优化导航组件

- 从 app-top-nav.tsx 中移除登出相关代码和 LogOut 图标
- 从 canvas-client-page.tsx 中移除用户信息显示和登出回调函数
- 从 admin layout.tsx 中移除登出菜单项
- 将 navigation-tools 从 lib 目录迁移到 constant 目录
- 更新 UserStatusActions 组件以简化用户菜单逻辑
- 在用户状态操作组件中集成快捷键功能和管理员入口
This commit is contained in:
HouYunFei
2026-05-21 15:22:01 +08:00
parent e3d8fc092d
commit f26797b5c7
4 changed files with 30 additions and 46 deletions
@@ -2160,16 +2160,12 @@ function CanvasTopBar({
<div className="pointer-events-auto flex items-center gap-1.5">
<UserStatusActions
variant="canvas"
accountOpen={accountOpen}
onAccountOpenChange={setAccountOpen}
accountRef={accountRef}
getPopupContainer={(node) => node.parentElement || document.body}
onOpenShortcuts={() => { setShortcutsOpen(true); setAccountOpen(false); }}
iconStyle={{ color: theme.node.text }}
gitHubClassName="size-11 text-base"
gitHubStyle={{ color: theme.node.text }}
versionStyle={{ color: theme.node.text }}
avatarStyle={{ borderColor: theme.toolbar.border, color: theme.node.text }}
/>
{assistantCollapsed ? (
<>
+1 -10
View File
@@ -1,22 +1,13 @@
"use client";
import type { ReactNode } from "react";
import { usePathname } from "next/navigation";
import { AppTopNav } from "@/components/layout/app-top-nav";
import { type NavigationToolSlug, navigationTools } from "@/constant/navigation-tools";
import { useConfigStore } from "@/stores/use-config-store";
export default function UserLayout({ children }: { children: ReactNode }) {
const pathname = usePathname();
const config = useConfigStore((state) => state.config);
const updateConfig = useConfigStore((state) => state.updateConfig);
const slug = pathname.split("/").filter(Boolean)[0];
const activeToolSlug = navigationTools.some((tool) => tool.slug === slug) ? (slug as NavigationToolSlug) : undefined;
return (
<div className="flex h-dvh flex-col overflow-hidden bg-background text-foreground">
<AppTopNav activeToolSlug={activeToolSlug} config={config} onConfigChange={updateConfig} hideHeader={/^\/canvas\/[^/]+/.test(pathname)} />
<AppTopNav />
<div className="min-h-0 flex-1 overflow-hidden">{children}</div>
</div>
);