修复登录成功获取用户信息

This commit is contained in:
whyour 2022-05-19 23:40:19 +08:00
parent 03bc5bb882
commit 1ba5d52ee7
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ export default function (props: any) {
};
useEffect(() => {
if (systemInfo && systemInfo.isInitialized && !user.username) {
if (systemInfo && systemInfo.isInitialized) {
getUser();
}
}, [props.location.pathname]);

View File

@ -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<any>();
const { theme } = useTheme();
@ -100,8 +100,8 @@ const Login = () => {
<div>{retries > 0 ? `失败${retries}` : '成功'}</div>
</>
),
duration: 5,
});
reloadUser();
history.push('/crontab');
} else if (data.code === 100) {
message.warn(data.message);