From a18d24b6e676c512f236f553013b976587d3e131 Mon Sep 17 00:00:00 2001 From: ZLY Date: Tue, 2 Dec 2025 14:35:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(navbar):=20=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA=E5=92=8C=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NavBar/index.tsx | 34 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx index 40d8615..0bcb3ff 100644 --- a/src/components/NavBar/index.tsx +++ b/src/components/NavBar/index.tsx @@ -8,7 +8,8 @@ import { import { IconSettings, IconPoweroff, - IconLoading + IconLoading, + IconUser } from '@arco-design/web-react/icon'; import { useSelector, useDispatch } from 'react-redux'; import { GlobalContext } from '@/context'; @@ -38,7 +39,7 @@ function Navbar({ show }: { show: boolean }) { } function onMenuItemClick(key) { - handleLogout(); + if (key === 'logout') handleLogout(); } useEffect(() => { @@ -69,6 +70,10 @@ function Navbar({ show }: { show: boolean }) { const droplist = ( + + + {userInfo.account} + {t['navbar.logout']} @@ -94,17 +99,20 @@ function Navbar({ show }: { show: boolean }) {
    {userInfo && ( -
  • - - - {userLoading ? ( - - ) : ( - avatar - )} - - -
  • + <> +
  • + + + {userLoading ? ( + + ) : ( + avatar + )} + + {userInfo.account} + +
  • + )}