= ({
top: 0
}}
>
- {/* 左侧区域:折叠按钮和面包屑 */}
- {/* 右侧区域:搜索框和用户菜单 */}
- {/* 搜索框 */}
= ({
/>
- {/* 用户菜单 */}
= ({
- {/* 搜索对话框 */}
= ({ collapsed, isMobile = false, onClose,
// 管理后台路径处理
if (area === 'admin') {
// 提取 /admin/ 后面的部分
- const adminPath = pathname.replace(/^\/admin\/?/, '');
+ let adminPath = pathname.replace(/^\/admin\/?/, '');
// 如果是管理后台首页
if (adminPath === '') {
@@ -87,18 +87,25 @@ const Sidebar: React.FC = ({ collapsed, isMobile = false, onClose,
return defaultRoute ? defaultRoute.path : '';
}
+ // 先尝试精确匹配
+ const exactMatch = routes.find(route => route.path === adminPath);
+ if (exactMatch) {
+ return exactMatch.path;
+ }
+
+ // 再尝试参数路由匹配
const matchedRoute = routes.find(route => {
if (route.path.includes(':')) {
const basePath = route.path.split(':')[0].replace(/\/$/, '');
return adminPath.startsWith(basePath);
}
- return adminPath === route.path;
+ return false;
});
return matchedRoute ? matchedRoute.path : '';
}
- // 主应用路径处理
+ // 主应用路径处理保持不变
const matchedRoute = routes.find(route => {
if (route.path.includes(':')) {
const basePath = route.path.split(':')[0].replace(/\/$/, '');
diff --git a/Web/src/pages/allImages/Index.tsx b/Web/src/pages/allImages/Index.tsx
index 63181e3..4f5c55e 100644
--- a/Web/src/pages/allImages/Index.tsx
+++ b/Web/src/pages/allImages/Index.tsx
@@ -12,7 +12,7 @@ function AllImages() {
const isMobile = useIsMobile();
const [, setImages] = useState([]);
const [currentPage, setCurrentPage] = useState(1);
- const [pageSize, setPageSize] = useState(20);
+ const [pageSize, setPageSize] = useState(50);
const [sortBy, setSortBy] = useState('uploadDate_desc');
const [isUploadDialogVisible, setIsUploadDialogVisible] = useState(false);
const [refreshTrigger, setRefreshTrigger] = useState(0);
diff --git a/Web/src/routes/index.tsx b/Web/src/routes/index.tsx
index 0805af6..31af2db 100644
--- a/Web/src/routes/index.tsx
+++ b/Web/src/routes/index.tsx
@@ -157,7 +157,7 @@ const routes: RouteConfig[] = [
hideInMenu: true,
breadcrumb: {
title: '用户详情',
- parent: 'users'
+ parent: 'admin-user' // 修改: 指向父路由的 key
}
},
{