Przeglądaj źródła

调整跳转成本应用的逻辑

code4eat 2 lat temu
rodzic
commit
c34a4c875b
3 zmienionych plików z 34 dodań i 8 usunięć
  1. 2 2
      config/proxy.ts
  2. 2 2
      src/app.tsx
  3. 30 4
      src/pages/platform/_layout.tsx

+ 2 - 2
config/proxy.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:00:52
- * @LastEditTime: 2023-04-03 17:37:13
+ * @LastEditTime: 2023-04-17 11:15:10
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/proxy.ts
@@ -16,7 +16,7 @@ const proxy: { [key: string]: any } = {
   dev: {
     //绩效管理
     '/gateway': {
-      target: 'http://120.27.235.181:5000',
+      target: 'http://47.96.149.190:5000',
       //target: 'http://118.31.245.65:7005/',
       changeOrigin: true,
       // pathRewrite: { '^/master': '' },

+ 2 - 2
src/app.tsx

@@ -248,9 +248,9 @@ export const qiankun = fetch('/config').then(() => ({
     // },
     {
       name: 'budgetManaSystem', // 唯一 id
-      entry: '//localhost:8001',
+      //entry: '//localhost:8001',
       //entry: '//120.27.235.181:5000/perform/',  //开发
-      //entry: '//47.96.149.190:5000/perform/', //演示
+      entry: '//47.96.149.190:5000/perform/', //演示
     },
     {
       name: 'PFMBackC', // 唯一 id

+ 30 - 4
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2023-03-23 16:41:41
+ * @LastEditTime: 2023-04-17 14:59:06
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/_layout.tsx
@@ -17,6 +17,8 @@ import { Iframe, SpacicalPageParamsType } from '@/typings';
 import { Key, useEffect, useState } from 'react';
 import IconFont from '@ant-design/icons/lib/components/IconFont';
 import { FileOutlined, FolderOutlined, SmileOutlined } from '@ant-design/icons';
+import { getParamsManaTableData } from './setting/paramsMana/service';
+import { getAllParams } from '@/service';
 
 export default function Layout({ children, location, route, history, match, ...rest }: IRouteComponentProps) {
   const { initialState, setInitialState } = useModel('@@initialState');
@@ -26,8 +28,7 @@ export default function Layout({ children, location, route, history, match, ...r
   const [isShowPageMenu, set_isShowPageMenu] = useState(true);
   const [isEmpty, set_isEmpty] = useState(false);
 
-  //const isShowMenu = localStorage.getItem('isChildShowMenu');
-  // console.log({ children, location, route, history, match});
+
 
   const { pathname } = location;
 
@@ -66,7 +67,32 @@ export default function Layout({ children, location, route, history, match, ...r
   //临时演示处理
 
   if (location.pathname == '/platform/costMana') {
-    return <iframe id={'bi_iframe'} style={{ width: '100%', height: '100%', border: 'none' }} src="http://112.124.59.133:4000/platformMana/roleManage?hospSign=dOBHdoPmJgPGnMSH" onLoad={() => adjustIframe()} ></iframe>;
+
+    //临时解决未嵌入成本核算,而实现访问的效果
+    const [pageUrl,set_pageUrl] = useState<string|undefined>(undefined);
+
+    const getToken =async () => {
+      const resp = await getAllParams();
+
+    if (resp) {
+      const needItem = resp.filter((a: any) => a.code == '1647777324889935872');
+    
+      if (needItem.length > 0) {
+          set_pageUrl(`http://localhost:8002/platformMana/roleManage?hospSign=dOBHdoPmJgPGnMSH&token=${needItem[0].value}`)
+      }
+    }
+    }
+    
+    useEffect(()=>{
+      getToken();
+    },[])
+
+
+    return (
+      <>
+         {pageUrl&&<iframe id={'bi_iframe'} style={{ width: '100%', height: '100%', border: 'none' }} src={pageUrl} onLoad={() => adjustIframe()} ></iframe>};
+      </>
+    )
   }