|
@@ -1,7 +1,7 @@
|
|
/*
|
|
/*
|
|
* @Author: your name
|
|
* @Author: your name
|
|
* @Date: 2021-11-10 09:33:30
|
|
* @Date: 2021-11-10 09:33:30
|
|
- * @LastEditTime: 2021-12-20 10:24:05
|
|
|
|
|
|
+ * @LastEditTime: 2021-12-21 11:04:18
|
|
* @LastEditors: Please set LastEditors
|
|
* @LastEditors: Please set LastEditors
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/index.tsx
|
|
@@ -10,7 +10,7 @@
|
|
import { useState, useEffect } from 'react';
|
|
import { useState, useEffect } from 'react';
|
|
import TopBar from './components/topBar';
|
|
import TopBar from './components/topBar';
|
|
import IframePage from './components/iframePage';
|
|
import IframePage from './components/iframePage';
|
|
-import { useModel, MicroApp } from 'umi';
|
|
|
|
|
|
+import { useModel,history } from 'umi';
|
|
import './index.less';
|
|
import './index.less';
|
|
|
|
|
|
const IndexPage = () => {
|
|
const IndexPage = () => {
|
|
@@ -87,10 +87,27 @@ const IndexPage = () => {
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (systemLists) setSelectableSysList(systemLists);
|
|
if (systemLists) setSelectableSysList(systemLists);
|
|
if (openedSysLists) setOpenTabs(openedSysLists);
|
|
if (openedSysLists) setOpenTabs(openedSysLists);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ window.addEventListener('message', function(event){
|
|
|
|
+ if (event.origin === "http://localhost:8804"){
|
|
|
|
+ console.log(event.data);
|
|
|
|
+ if(event.data.type == 'LOGOUT'){
|
|
|
|
+ history.replace('/login')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }, false);
|
|
|
|
+
|
|
|
|
+ return ()=>{
|
|
|
|
+ window.removeEventListener('message',()=>{});
|
|
|
|
+ }
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
if (loading) return <h1>Loading...</h1>;
|
|
if (loading) return <h1>Loading...</h1>;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className="indexPage">
|
|
<div className="indexPage">
|
|
<TopBar
|
|
<TopBar
|