This commit is contained in:
Zeke Zhang 2025-03-06 20:33:42 +08:00
parent 0c6c3f3a82
commit d45eefe644

View File

@ -215,7 +215,15 @@ const InternalPageContent = (props: PageContentProps) => {
// 兼容旧版本的 tab 路径
const oldTab = currentRoute?.children?.find((tabRoute) => tabRoute.tabSchemaName === activeKey);
if (oldTab) {
navigate(location.pathname.replace(activeKey, oldTab.schemaUid) + location.search);
const searchParams = new URLSearchParams(location.search);
// Check if activeKey exists in search params and remove it
if (searchParams.has('tab') && searchParams.get('tab') === activeKey) {
searchParams.delete('tab');
}
// Create a clean search string or empty string if only '?' remains
const searchString = searchParams.toString() ? `?${searchParams.toString()}` : '';
navigate(location.pathname.replace(activeKey, oldTab.schemaUid) + searchString);
return null;
}