From d4dd299c90baa297f09f0708d326e347d277361a Mon Sep 17 00:00:00 2001 From: yuj Date: Fri, 5 Dec 2025 10:14:15 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=20=E4=BF=AE=E6=94=B9=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.css | 10 +++-- src/components/Layout.tsx | 77 ++++++++++++++++++++++++++------------- 2 files changed, 59 insertions(+), 28 deletions(-) diff --git a/src/App.css b/src/App.css index df47fb1..7770020 100644 --- a/src/App.css +++ b/src/App.css @@ -216,8 +216,12 @@ a{color:inherit; text-decoration:none} .main{flex:1; display:flex; flex-direction:column; min-width:0; height:100vh; overflow:hidden; width:100%} .subnav{ background:var(--panel); - padding:12px 22px; border-bottom:1px solid var(--border); flex-shrink:0; - overflow-x:auto; -webkit-overflow-scrolling:touch; + padding:16px 24px; + border-bottom:1px solid var(--border); + flex-shrink:0; + overflow-x:auto; + -webkit-overflow-scrolling:touch; + margin-top: 20px; } .segment{ display:flex; gap:8px; background:var(--soft); padding:6px; border-radius:12px; border:1px solid var(--border); width:max-content; @@ -229,7 +233,7 @@ a{color:inherit; text-decoration:none} background:var(--panel); color:var(--text); box-shadow:var(--shadow); } -.content{padding:22px; display:flex; flex-direction:column; gap:16px; flex:1; overflow-y:auto; min-height:0; box-sizing:border-box} +.content{padding:28px 24px; display:flex; flex-direction:column; gap:20px; flex:1; overflow-y:auto; min-height:0; box-sizing:border-box} .panel{ background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:18px; box-shadow:var(--shadow); diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 03bccac..5ca7496 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -165,13 +165,62 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => { + {/* 用户登录状态和登出按钮 */} +
+ {token && ( + <> + {!collapsed && ( + + 已登录 + + )} + + + )} +
+
{!collapsed ? 'v1.1 · React Admin' : 'v1.1'}
@@ -179,28 +228,6 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => { {/* 主内容区 */}
-
-
- -
-
-
- {token ? ( - <> - 已登录 - - - ) : null} -
-
-
- {/* 监控页面的子导航 */} {activeTab === 'monitoring' && (