Просмотр исходного кода

修复扎实成本iframe的是hook报错

code4eat 2 лет назад
Родитель
Сommit
5c0ed3ab1c
2 измененных файлов с 7 добавлено и 8 удалено
  1. 2 2
      config/config.ts
  2. 5 6
      src/pages/platform/_layout.tsx

+ 2 - 2
config/config.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-07 10:04:20
- * @LastEditTime: 2023-03-21 09:31:27
+ * @LastEditTime: 2023-04-17 15:42:29
  * @LastEditors: code4eat awesomedema@gmail.com
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: /KC-MiddlePlatform/config/config.ts
@@ -214,7 +214,7 @@ export default defineConfig({
   layout: {
     layout: 'top',
   },
-  // mfsu: {},
+  mfsu: {},
   qiankun: {
     master: {
       sandbox: {

+ 5 - 6
src/pages/platform/_layout.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 15:25:39
- * @LastEditTime: 2023-04-17 15:32:38
+ * @LastEditTime: 2023-04-17 15:54:58
  * @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
@@ -28,6 +28,8 @@ export default function Layout({ children, location, route, history, match, ...r
   const [isShowPageMenu, set_isShowPageMenu] = useState(true);
   const [isEmpty, set_isEmpty] = useState(false);
 
+  const [pageUrl,set_pageUrl] = useState<string|undefined>(undefined);
+
 
 
   const { pathname } = location;
@@ -69,8 +71,7 @@ export default function Layout({ children, location, route, history, match, ...r
   if (location.pathname == '/platform/costMana') {
 
     //临时解决未嵌入成本核算,而实现访问的效果
-    const [pageUrl,set_pageUrl] = useState<string|undefined>(undefined);
-
+  
     const getToken =async () => {
       const resp = await getAllParams();
 
@@ -83,9 +84,7 @@ export default function Layout({ children, location, route, history, match, ...r
     }
     }
     
-    useEffect(()=>{
-      getToken();
-    },[])
+    getToken();
 
 
     return (