- Add error.tsx and loading.tsx boundaries for admin, parent, student, teacher routes - Add dashboard-error-fallback and dashboard-loading-skeleton components - Add student/learning page, parent/leave routes, teacher textbook components - Update existing app routes across auth, dashboard, and API endpoints - Update proxy middleware and next-auth type declarations
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { Stethoscope } from "lucide-react"
|
|
import { requirePermission } from "@/shared/lib/auth-guard"
|
|
import { Permissions } from "@/shared/types/permissions"
|
|
import { getStudentMasterySummary } from "@/modules/diagnostic/data-access"
|
|
import { getDiagnosticReports } from "@/modules/diagnostic/data-access-reports"
|
|
import { StudentDiagnosticView } from "@/modules/diagnostic/components/student-diagnostic-view"
|
|
|
|
export const dynamic = "force-dynamic"
|
|
|
|
export default async function StudentDiagnosticPage() {
|
|
const ctx = await requirePermission(Permissions.DIAGNOSTIC_READ)
|
|
|
|
const [summary, reportsResult] = await Promise.all([
|
|
getStudentMasterySummary(ctx.userId),
|
|
// v4-P1-3: 学生仅可见已发布报告,避免草稿泄露
|
|
getDiagnosticReports(
|
|
{ studentId: ctx.userId, status: "published" },
|
|
ctx.dataScope,
|
|
),
|
|
])
|
|
const reports = reportsResult.reports
|
|
|
|
return (
|
|
<div className="space-y-8">
|
|
<div>
|
|
<h2 className="flex items-center gap-2 text-2xl font-bold tracking-tight">
|
|
<Stethoscope className="h-6 w-6" />
|
|
My Diagnostic
|
|
</h2>
|
|
<p className="text-muted-foreground">
|
|
Your knowledge point mastery analysis and diagnostic reports.
|
|
</p>
|
|
</div>
|
|
<StudentDiagnosticView summary={summary} reports={reports} />
|
|
</div>
|
|
)
|
|
}
|