diff --git a/src/app.tsx b/src/app.tsx index fc6f598..2c8b9b5 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -95,6 +95,8 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = fetchUserInfo?.(setInitialState); } }, + pure: !!new URLSearchParams(window.location.search), // 删除自带页面 + // pure:true, links: isDev ? [ @@ -123,17 +125,17 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = return []; } // initialState.currentUser 中包含了所有用户信息 - let menus = await getRoutersInfo(); + const menus = await getRoutersInfo(); const urlParams = new URLSearchParams(window.location.search); - const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名 - if (hideInMenu) { - menus = menus.map((item) => { - return { - ...item, - hideInMenu: true, - }; - }); - } + // const hideInMenu = urlParams.get('hideInMenu'); // 替换 'hideInMenu' 为你要获取的参数名 + // if (hideInMenu) { + // menus = menus.map((item) => { + // return { + // ...item, + // hideInMenu: true, + // }; + // }); + // } setInitialState((preInitialState: any) => ({ ...preInitialState, menus, diff --git a/src/components/KeepAliveTabs/index.tsx b/src/components/KeepAliveTabs/index.tsx index 388cd9e..ee87873 100644 --- a/src/components/KeepAliveTabs/index.tsx +++ b/src/components/KeepAliveTabs/index.tsx @@ -222,7 +222,7 @@ const KeepAliveTabs = () => { return ( //