From bdecdce118c7b805289d0425763c38ea0a194f97 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 19 May 2022 23:40:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/index.tsx | 2 +- src/pages/login/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index ed09eb0c..86d329c3 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -101,7 +101,7 @@ export default function (props: any) { }; useEffect(() => { - if (systemInfo && systemInfo.isInitialized && !user.username) { + if (systemInfo && systemInfo.isInitialized) { getUser(); } }, [props.location.pathname]); diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index cb7e2ea1..62b0ff73 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -18,7 +18,7 @@ import { MobileOutlined } from '@ant-design/icons'; const FormItem = Form.Item; const { Countdown } = Statistic; -const Login = () => { +const Login = ({ reloadUser }: any) => { const [loading, setLoading] = useState(false); const [waitTime, setWaitTime] = useState(); const { theme } = useTheme(); @@ -100,8 +100,8 @@ const Login = () => {
上次登录状态:{retries > 0 ? `失败${retries}次` : '成功'}
), - duration: 5, }); + reloadUser(); history.push('/crontab'); } else if (data.code === 100) { message.warn(data.message);