From bc3eeb03d23bdf397d50a327b70bd017c6d15f49 Mon Sep 17 00:00:00 2001 From: zhangheng Date: Wed, 8 Apr 2026 15:56:26 +0800 Subject: [PATCH 1/2] feat(layout): username --- components/layout/AppLayout.tsx | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/components/layout/AppLayout.tsx b/components/layout/AppLayout.tsx index 97c4745..0a21bfe 100644 --- a/components/layout/AppLayout.tsx +++ b/components/layout/AppLayout.tsx @@ -11,20 +11,14 @@ import { ScrollArea, Space, Stack, + Text, Tooltip, UnstyledButton, useComputedColorScheme, useMantineColorScheme, } from "@mantine/core" import { useDisclosure, useMediaQuery } from "@mantine/hooks" -import { - IconLogout, - IconMessageCircle, - IconMoon, - IconSettings, - IconSun, - IconUser, -} from "@tabler/icons-react" +import { IconLogout, IconMoon, IconSun, IconUser } from "@tabler/icons-react" import cx from "clsx" import { Suspense, useEffect, useMemo, useState } from "react" import actionToggleClasses from "./ActionToggle.module.css" @@ -32,6 +26,7 @@ import headerLinkClasses from "./HeaderLink.module.css" import { useUserStore } from "@/app/store/user" import { usePathname, useRouter } from "next/navigation" +import { usePermissionStore } from "../label/store/auth" import { deleteCookie } from "../login/api" import { MenuItem, withoutLayoutRoutes } from "./common" import { ClientIcon } from "./components/ClientIcon" @@ -147,6 +142,7 @@ export default function AppLayout({ window.location.reload() } const matches = useMediaQuery("(min-width: 48em)") + const userName = usePermissionStore((s) => s.user_name) return isClient ? ( withoutLayout ? ( @@ -199,7 +195,7 @@ export default function AppLayout({ /> - + - 个人信息 - }> - 设置 - - }> - 通知 - + 用户信息 + + + {userName || "-"} + + 操作 Date: Wed, 8 Apr 2026 16:44:04 +0800 Subject: [PATCH 2/2] fix(env): backend --- components/label/api/const.ts | 2 +- components/login/api/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/label/api/const.ts b/components/label/api/const.ts index 617b20e..725ec56 100644 --- a/components/label/api/const.ts +++ b/components/label/api/const.ts @@ -1,6 +1,6 @@ export const BASE_LABEL_API = process.env.NEXT_PUBLIC_ENV === "production" - ? "http://172.16.104.95:9110" + ? "http://172.16.103.224:9110" : process.env.NEXT_PUBLIC_ENV === "staging" ? "http://172.16.115.128:9110" : "https://label.softtest.cowarobot.com" diff --git a/components/login/api/index.ts b/components/login/api/index.ts index 9077f8f..2b779b6 100644 --- a/components/login/api/index.ts +++ b/components/login/api/index.ts @@ -4,7 +4,7 @@ import { Login } from "./types" const BASE_PATH = process.env.NEXT_PUBLIC_ENV === "production" - ? "http://172.16.104.95:9110" + ? "http://172.16.103.224:9110" : process.env.NEXT_PUBLIC_ENV === "staging" ? "http://172.16.115.128:9110" : "https://label.softtest.cowarobot.com"