This commit is contained in:
freedakgmail
2025-11-23 08:04:43 +08:00
parent e92884ae53
commit 81dbf709aa
95 changed files with 166729 additions and 2241 deletions
-3
View File
@@ -16,7 +16,6 @@ export async function GET(
}
const { treeId } = await params
console.log('API /trees/[treeId] - Requested treeId:', treeId)
const tree = await prisma.familyTree.findFirst({
where: {
@@ -50,11 +49,9 @@ export async function GET(
})
if (!tree) {
console.log('API /trees/[treeId] - Tree not found for id:', treeId)
return NextResponse.json({ error: "家族树不存在或无权访问" }, { status: 404 })
}
console.log('API /trees/[treeId] - Returning tree:', tree.name, tree.id)
return NextResponse.json({ tree })
} catch (error) {
console.error("获取家族树失败:", error)
+1 -4
View File
@@ -29,13 +29,10 @@ interface ActivityLog {
}
export default function DashboardPage() {
const { treeData, currentTree, isLoading } = useFamily()
const { treeData, isLoading, currentTree } = useFamily()
const { data: session } = useSession()
const [recentActivities, setRecentActivities] = useState<ActivityLog[]>([])
// 调试日志
console.log('Dashboard - treeData:', treeData, 'currentTree:', currentTree?.name, 'isLoading:', isLoading)
// 加载最近的操作日志
useEffect(() => {
if (currentTree?.id && session?.user?.id) {