From 6200e1dbeb64589620dfe42e687f4dee4771805b Mon Sep 17 00:00:00 2001 From: Kylin Date: Fri, 30 Sep 2022 11:17:58 +0800 Subject: [PATCH] fix: You may NOT need # b9163ae and # 00151a6 (#10257) --- src/components/RightContent/AvatarDropdown.tsx | 4 ++-- src/pages/User/Login/index.tsx | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/RightContent/AvatarDropdown.tsx b/src/components/RightContent/AvatarDropdown.tsx index ac7f670c..9f91b368 100644 --- a/src/components/RightContent/AvatarDropdown.tsx +++ b/src/components/RightContent/AvatarDropdown.tsx @@ -19,8 +19,8 @@ const AvatarDropdown: React.FC = ({ menu }) => { */ const loginOut = async () => { await outLogin(); - const { search, pathname } = history.location; - const urlParams = new URL(history.location.search).searchParams; + const { search, pathname } = window.location; + const urlParams = new URL(window.location.href).searchParams; /** 此方法会跳转到 redirect 参数所在的位置 */ const redirect = urlParams.get('redirect'); // Note: There may be security issues, please note diff --git a/src/pages/User/Login/index.tsx b/src/pages/User/Login/index.tsx index 70238b4b..3a687388 100644 --- a/src/pages/User/Login/index.tsx +++ b/src/pages/User/Login/index.tsx @@ -38,7 +38,7 @@ const LoginMessage: React.FC<{ const Login: React.FC = () => { const [userLoginState, setUserLoginState] = useState({}); const [type, setType] = useState('account'); - const { initialState, refresh, setInitialState } = useModel('@@initialState'); + const { initialState, setInitialState } = useModel('@@initialState'); const intl = useIntl(); @@ -63,7 +63,6 @@ const Login: React.FC = () => { }); message.success(defaultLoginSuccessMessage); await fetchUserInfo(); - await refresh(); const urlParams = new URL(window.location.href).searchParams; history.push(urlParams.get('redirect') || '/'); return;