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', }}