登录增加最后登录时间地点,登录失败增加重试间隔

This commit is contained in:
hanhh
2021-08-22 01:22:23 +08:00
parent 61e41269ba
commit 54bb13aad0
9 changed files with 365 additions and 69 deletions
+16 -2
View File
@@ -1,5 +1,5 @@
import React, { Fragment, useEffect } from 'react';
import { Button, Row, Input, Form, message } from 'antd';
import { Button, Row, Input, Form, message, notification } from 'antd';
import config from '@/utils/config';
import { history, Link } from 'umi';
import styles from './index.less';
@@ -18,7 +18,21 @@ const Login = () => {
})
.then((data) => {
if (data.code === 200) {
localStorage.setItem(config.authKey, data.token);
const { token, lastip, lastaddr, lastlogon } = data.data;
localStorage.setItem(config.authKey, token);
notification.success({
message: '登录成功!',
description: (
<div>
<div>
{new Date(lastlogon).toLocaleString() || '-'}
</div>
<div>{lastaddr || '-'}</div>
<div>IP{lastip || '-'}</div>
</div>
),
duration: 5,
});
history.push('/crontab');
} else if (data.code === 100) {
message.warn(data.message);