mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
修复登录成功获取用户信息
This commit is contained in:
parent
03bc5bb882
commit
1ba5d52ee7
|
@ -101,7 +101,7 @@ export default function (props: any) {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (systemInfo && systemInfo.isInitialized && !user.username) {
|
if (systemInfo && systemInfo.isInitialized) {
|
||||||
getUser();
|
getUser();
|
||||||
}
|
}
|
||||||
}, [props.location.pathname]);
|
}, [props.location.pathname]);
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { MobileOutlined } from '@ant-design/icons';
|
||||||
const FormItem = Form.Item;
|
const FormItem = Form.Item;
|
||||||
const { Countdown } = Statistic;
|
const { Countdown } = Statistic;
|
||||||
|
|
||||||
const Login = () => {
|
const Login = ({ reloadUser }: any) => {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [waitTime, setWaitTime] = useState<any>();
|
const [waitTime, setWaitTime] = useState<any>();
|
||||||
const { theme } = useTheme();
|
const { theme } = useTheme();
|
||||||
|
@ -100,8 +100,8 @@ const Login = () => {
|
||||||
<div>上次登录状态:{retries > 0 ? `失败${retries}次` : '成功'}</div>
|
<div>上次登录状态:{retries > 0 ? `失败${retries}次` : '成功'}</div>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
duration: 5,
|
|
||||||
});
|
});
|
||||||
|
reloadUser();
|
||||||
history.push('/crontab');
|
history.push('/crontab');
|
||||||
} else if (data.code === 100) {
|
} else if (data.code === 100) {
|
||||||
message.warn(data.message);
|
message.warn(data.message);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user