|
@@ -107,13 +107,15 @@ export default (props) => {
|
|
|
|
|
|
let setTimer = useRef();
|
|
|
|
|
|
- clearTimeout(setTimer.current);
|
|
|
- setTimer.current = null;
|
|
|
- setTimer.current = setTimeout(() => {
|
|
|
- console.log('----没有点击,退出');
|
|
|
- window.open('http://10.100.28.70/saasweb/middleware/', '_top');
|
|
|
- }, 1000 * 60 * 5);
|
|
|
-
|
|
|
+ const logOut = () => {
|
|
|
+ clearTimeout(setTimer.current);
|
|
|
+ setTimer.current = null;
|
|
|
+ setTimer.current = setTimeout(() => {
|
|
|
+ console.log('----没有点击,退出');
|
|
|
+ window.parent.postMessage('loginOut', '*');
|
|
|
+ }, 1000 * 60 * 5);
|
|
|
+ };
|
|
|
+ logOut();
|
|
|
useEffect(() => {
|
|
|
clearTimeout(setTimer.current);
|
|
|
setTimer.current = null;
|
|
@@ -123,12 +125,7 @@ export default (props) => {
|
|
|
className={styles.layout}
|
|
|
onClick={(event) => {
|
|
|
console.log('----已点击等待超时,退出');
|
|
|
- clearTimeout(setTimer.current);
|
|
|
- setTimer.current = null;
|
|
|
- setTimer.current = setTimeout(() => {
|
|
|
- console.log('----点击超时,退出');
|
|
|
- window.open('http://10.100.28.70/saasweb/middleware/', '_top');
|
|
|
- }, 1000 * 60 * 5);
|
|
|
+ logOut();
|
|
|
}}
|
|
|
>
|
|
|
<div className={styles.header}>
|