From d9f7feca0fbe4c1f29ed37e0c7b17413be87bc21 Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Wed, 7 Jan 2026 11:17:17 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E7=94=A8=E6=88=B7=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E5=88=86=E6=9E=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DashboardLayout/SiderMenu.tsx | 7 ++++++- src/components/DashboardLayout/TopMenu.tsx | 2 +- src/views/yhxwfx/index.js | 6 +++--- src/views/yhxwfx/userBarOption.js | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/DashboardLayout/SiderMenu.tsx b/src/components/DashboardLayout/SiderMenu.tsx index f8ed96d01..be7298d8a 100644 --- a/src/components/DashboardLayout/SiderMenu.tsx +++ b/src/components/DashboardLayout/SiderMenu.tsx @@ -31,7 +31,12 @@ const SiderMenu: React.FC<{ const pathname = location.pathname; const navigate = useNavigate(); - + // 当menuIndexes[1]变化时,更新openKeys + useEffect(() => { + if (menuIndexes[1]) { + setOpenKeys([`${menuIndexes[1]}`]); + } + }, [menuIndexes[1]]); function goto(url: string) { if (pathname !== url) { navigate(url); diff --git a/src/components/DashboardLayout/TopMenu.tsx b/src/components/DashboardLayout/TopMenu.tsx index 20c17aa19..0eb135c03 100644 --- a/src/components/DashboardLayout/TopMenu.tsx +++ b/src/components/DashboardLayout/TopMenu.tsx @@ -12,7 +12,7 @@ function getMenuUrl(menuItem: MenuItem | undefined): string | null { return null; } - const url = menuItem.path || menuItem.redirect; + const url = menuItem.path; if (url) { return url; } diff --git a/src/views/yhxwfx/index.js b/src/views/yhxwfx/index.js index bc00f4b3d..364566653 100644 --- a/src/views/yhxwfx/index.js +++ b/src/views/yhxwfx/index.js @@ -138,7 +138,7 @@ const Page = () => {
- WEB端访问次数 + WEB端访问用户

{todayData?.web1Count || '-' }

@@ -154,7 +154,7 @@ const Page = () => {
- 移动端访问次数 + 移动端访问用户

{todayData?.app1Count || '-'}

@@ -181,7 +181,7 @@ const Page = () => {
- 访问用户前十 + 浏览次数前十