From 33b5372f39053a47557289c7b2ac29d27f46f0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 9 Mar 2023 15:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 43ca052..402c134 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -58,7 +58,7 @@ export const Login: React.FC = () => { .then((res: any) => { const token = res.data.token; setToken(token); - setLoading(false); + getUser(); }) .catch((e) => { @@ -74,6 +74,7 @@ export const Login: React.FC = () => { dispatch(IsLoginActionCreator()); dispatch(SetUserActionCreator(data.user)); dispatch(SetPermisssionsActionCreator(data.permissions)); + setLoading(false); navigate("/"); }); }; @@ -134,6 +135,7 @@ export const Login: React.FC = () => { style={{ width: 400, height: 54 }} type="primary" onClick={loginSubmit} + loading={loading} > 立即登录