code4eat 3 anos atrás
pai
commit
1ea3fc6ab6
6 arquivos alterados com 8 adições e 53 exclusões
  1. 2 2
      .umirc.ts
  2. 1 0
      mock/login.ts
  3. 2 48
      src/global.tsx
  4. 1 1
      src/models/index.ts
  5. 1 1
      src/pages/login/index.tsx
  6. 1 1
      src/service/api.d.ts

+ 2 - 2
.umirc.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-11-09 11:20:18
- * @LastEditTime: 2021-12-22 09:41:36
+ * @LastEditTime: 2022-01-06 11:20:55
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/.umirc.ts
@@ -14,7 +14,7 @@ export default defineConfig({
   },
   dva: {
     immer: true,
-    hmr: true,
+    hmr: false,
   },
   theme: {},
   routes: [

+ 1 - 0
mock/login.ts

@@ -7,6 +7,7 @@
  * @FilePath: /KC-MiddlePlatform/mock/login.ts
  */
 
+
 import { Request, Response } from 'express';
 
 const getList = (req: Request, res: Response, u: string) => {

+ 2 - 48
src/global.tsx

@@ -1,57 +1,11 @@
 /*
  * @Author: your name
  * @Date: 2021-12-21 11:05:37
- * @LastEditTime: 2021-12-22 09:02:37
+ * @LastEditTime: 2022-01-06 11:24:06
  * @LastEditors: Please set LastEditors
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/global.tsx
  */
 
 
-import {history } from 'umi';
-
-
-    window.stateFromTop = {   //挂载通信数据
-    
-    }
-
-    // window.addEventListener('message',event=>{
-    //         if(event.origin == 'http://localhost:8804'){
-    //              console.log({event});
-    //              window.stateFromTop = {  
-    //                   ...event
-    //              }
-    //         }
-    // });
-
-    window.postMessageToChild = async (data)=>{   //添加全局postMessageToChild函数
-          const iframes = document.getElementsByClassName('iframe');
-          Array.from(iframes).forEach((iframe) => {
-            const iframeWindow = iframe as HTMLIFrameElement;
-            if(iframeWindow&&iframeWindow.contentWindow){
-                iframeWindow.contentWindow.postMessage({...data},'http://localhost:8804')
-            } 
-          });
-        //   window.postMessage({...data},'http://localhost:8804')
-    }
-
-    window.removeListenner = async (handlerName:string)=>{   
-        console.log({handlerName});
-        window.removeEventListener('handlerName',()=>{
-            console.log('remove message listener');
-        });
-      //   window.postMessage({...data},'http://localhost:8804')
-    }  
-    
-    
-
-    window.addEventListener('message',(event)=>{
-        if (event.origin === "http://localhost:8804"){
-                 console.log(event.data);
-                 if(event.data.type == 'LOGOUT'){
-                    window.removeListenner('message');
-                    history.replace('/login');
-                 }
-        }
-        
-      }, false);
+import { history } from 'umi';

+ 1 - 1
src/models/index.ts

@@ -8,7 +8,7 @@
  */
 
 
-import { Effect, ImmerReducer, Reducer, Subscription } from 'umi';
+import { Effect, Reducer, Subscription } from 'umi';
 
 export interface IndexModelState {
   name: string;

+ 1 - 1
src/pages/login/index.tsx

@@ -20,7 +20,7 @@ import logo from '../../../public/images/kc-logo.png';
 import KCSelect from '@/components/kc-select';
 
 import { getSubHosp, login, getHospSubSystemList } from '@/service/login';
-import { LoginPageTypes } from './login';
+
 
 const { Option } = Select;
 

+ 1 - 1
src/service/api.d.ts

@@ -9,7 +9,7 @@
 
 
 declare namespace LoginApi {
-    type LoginParams = {
+      type LoginParams = {
         account:string,
         password:string,
         remember:boolean