|
@@ -1,6 +1,7 @@
|
|
|
-import React, { useRef, useState } from 'react';
|
|
|
+import React, { useRef, useState, useEffect } from 'react';
|
|
|
import { connect, useNavigate } from 'umi';
|
|
|
import { Form, Select, Input, Button, message } from 'antd';
|
|
|
+import { useModel } from '@umijs/max';
|
|
|
import { queryDepList } from '@/services/user';
|
|
|
import styles from './index.less';
|
|
|
import { UserOutlined, LockOutlined } from '@ant-design/icons';
|
|
@@ -13,6 +14,7 @@ function Login(props) {
|
|
|
params,
|
|
|
dispatch,
|
|
|
} = props;
|
|
|
+ const { run } = useModel('userInfo');
|
|
|
const [depList, setDepList] = useState([]);
|
|
|
const [hasName, setHasName] = useState(false);
|
|
|
const formRef = useRef();
|
|
@@ -47,10 +49,14 @@ function Login(props) {
|
|
|
},
|
|
|
callback: (token) => {
|
|
|
storeToken(token);
|
|
|
+ run();
|
|
|
navigate("/home");
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
+ useEffect(() => {
|
|
|
+ storeToken('');
|
|
|
+ }, []);
|
|
|
return (
|
|
|
<div className={styles.main}>
|
|
|
<div className={styles.content}>
|