From 2f0fe79e0de0cfc90bec6ca796406db4c6f12618 Mon Sep 17 00:00:00 2001 From: Gavan <994259213@qq.com> Date: Mon, 14 Jul 2025 17:53:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=B6=85=E5=87=BA=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/header/index.tsx | 11 +++++------ ui/src/index.css | 1 + ui/src/layouts/mainLayout/index.tsx | 2 +- ui/src/pages/dashboard/components/memberStatistic.tsx | 3 +-- .../user/dashboard/components/memberStatistic.tsx | 1 - 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ui/src/components/header/index.tsx b/ui/src/components/header/index.tsx index fa2fdd8..38f7177 100644 --- a/ui/src/components/header/index.tsx +++ b/ui/src/components/header/index.tsx @@ -1,6 +1,6 @@ import { Button, IconButton, Stack } from '@mui/material'; import { Icon, message } from '@c-x/ui'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useLocation } from 'react-router-dom'; import LogoutIcon from '@mui/icons-material/Logout'; import DownloadIcon from '@mui/icons-material/Download'; import { Box } from '@mui/material'; @@ -8,7 +8,7 @@ import Bread from './Bread'; const Header = () => { const navigate = useNavigate(); - + const { pathname } = useLocation(); return ( { }, }} onClick={() => { - // 清除本地存储的认证信息 - localStorage.removeItem('auth_token'); - localStorage.removeItem('user_info'); message.success('退出登录成功'); - navigate('/login', { replace: true }); + navigate(pathname.startsWith('/user/') ? '/user/login' : '/login', { + replace: true, + }); }} > diff --git a/ui/src/index.css b/ui/src/index.css index c48e990..a724d06 100644 --- a/ui/src/index.css +++ b/ui/src/index.css @@ -36,6 +36,7 @@ a { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; + min-width: 0; } .multiline-ellipsis { diff --git a/ui/src/layouts/mainLayout/index.tsx b/ui/src/layouts/mainLayout/index.tsx index fc2646d..4df1a38 100644 --- a/ui/src/layouts/mainLayout/index.tsx +++ b/ui/src/layouts/mainLayout/index.tsx @@ -51,7 +51,7 @@ const MainLayout = () => { }} > - +
diff --git a/ui/src/pages/user/dashboard/components/memberStatistic.tsx b/ui/src/pages/user/dashboard/components/memberStatistic.tsx index 2ab70f2..087c285 100644 --- a/ui/src/pages/user/dashboard/components/memberStatistic.tsx +++ b/ui/src/pages/user/dashboard/components/memberStatistic.tsx @@ -120,7 +120,6 @@ const MemberStatistic = ({ container spacing={2} sx={{ - height: '100%', overflow: 'auto', borderRadius: '10px', }}