From f2bbb406e61d81c8b3e7d2e5c7509357941c23b8 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Thu, 6 Mar 2025 17:22:51 +0800 Subject: [PATCH] fix: append search parameters to navigation paths for legacy route compatibility --- .../client/src/route-switch/antd/admin-layout/index.tsx | 9 ++++----- .../core/client/src/schema-component/antd/page/Page.tsx | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/core/client/src/route-switch/antd/admin-layout/index.tsx b/packages/core/client/src/route-switch/antd/admin-layout/index.tsx index b45e8df93f..14376e4533 100644 --- a/packages/core/client/src/route-switch/antd/admin-layout/index.tsx +++ b/packages/core/client/src/route-switch/antd/admin-layout/index.tsx @@ -11,7 +11,7 @@ import { EllipsisOutlined } from '@ant-design/icons'; import ProLayout, { RouteContext, RouteContextType } from '@ant-design/pro-layout'; import { HeaderViewProps } from '@ant-design/pro-layout/es/components/Header'; import { css } from '@emotion/css'; -import { ConfigProvider, Popover, Tooltip } from 'antd'; +import { Popover, Tooltip } from 'antd'; import React, { createContext, FC, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; import { Link, Navigate, Outlet, useLocation } from 'react-router-dom'; @@ -29,13 +29,12 @@ import { RemoteSchemaTemplateManagerProvider, SortableItem, useDesignable, - useGlobalTheme, useMenuDragEnd, useParseURLAndParams, useRequest, useSchemaInitializerRender, useSystemSettings, - useToken, + useToken } from '../../../'; import { CurrentPageUidProvider, @@ -72,7 +71,7 @@ const AllAccessDesktopRoutesContext = createContext<{ refresh: () => void; }>({ allAccessRoutes: emptyArray, - refresh: () => {}, + refresh: () => { }, }); AllAccessDesktopRoutesContext.displayName = 'AllAccessDesktopRoutesContext'; @@ -636,7 +635,7 @@ const LegacyRouteCompat: FC = (props) => { const location = useLocationNoUpdate(); if (route) { - return ; + return ; } return <>{props.children}; diff --git a/packages/core/client/src/schema-component/antd/page/Page.tsx b/packages/core/client/src/schema-component/antd/page/Page.tsx index 0f73c9cb5f..2b686e082d 100644 --- a/packages/core/client/src/schema-component/antd/page/Page.tsx +++ b/packages/core/client/src/schema-component/antd/page/Page.tsx @@ -215,7 +215,7 @@ const InternalPageContent = (props: PageContentProps) => { // 兼容旧版本的 tab 路径 const oldTab = currentRoute?.children?.find((tabRoute) => tabRoute.tabSchemaName === activeKey); if (oldTab) { - navigate(location.pathname.replace(activeKey, oldTab.schemaUid)); + navigate(location.pathname.replace(activeKey, oldTab.schemaUid) + location.search); return null; }