mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: append search parameters to navigation paths for legacy route compatibility
This commit is contained in:
parent
1abd11d0a1
commit
f2bbb406e6
@ -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 <Navigate to={location.pathname.replace(currentPageUid, route.schemaUid)} />;
|
||||
return <Navigate to={location.pathname.replace(currentPageUid, route.schemaUid) + location.search} />;
|
||||
}
|
||||
|
||||
return <>{props.children}</>;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user