feat: 添加管理后台页面和功能,优化测试和性能配置

refactor: 重构页面导航和滚动逻辑,提升用户体验

test: 更新测试配置和用例,增加覆盖率和稳定性

perf: 优化性能指标和阈值,适应开发环境需求

ci: 添加Lighthouse CI工作流,集成性能测试

docs: 更新API文档和健康检查端点

fix: 修复登录页面和表单提交问题

style: 调整响应式布局和可访问性改进

chore: 更新依赖项和脚本配置
This commit is contained in:
张翔
2026-03-24 10:11:30 +08:00
parent 08978d38c8
commit f5dec95a83
85 changed files with 12331 additions and 1408 deletions
+13 -8
View File
@@ -13,7 +13,7 @@ import {
X,
Activity
} from 'lucide-react';
import { useState } from 'react';
import { useState, useEffect } from 'react';
const navigation = [
{ name: '仪表盘', href: '/admin', icon: LayoutDashboard },
@@ -31,19 +31,24 @@ export default function AdminLayout({
const { data: session, status } = useSession();
const pathname = usePathname();
const [sidebarOpen, setSidebarOpen] = useState(false);
const [mounted, setMounted] = useState(false);
const isLoginPage = pathname === '/admin/login';
useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return null;
}
if (isLoginPage) {
return <>{children}</>;
return <div className="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100">{children}</div>;
}
if (status === 'loading') {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-[#C41E3A]"></div>
</div>
);
return null;
}
if (status === 'unauthenticated') {
@@ -151,4 +156,4 @@ export default function AdminLayout({
</main>
</div>
);
}
}