- Frontend: Next.js 15 (App Router), Auth.js v5, shadcn/ui, MagicUI - Backend: Go + Gin + GORM with layered architecture - Auth: Local credentials login with optional Keycloak OAuth binding - Admin: RBAC user management for admin role - Dev: Docker Compose with hot reload for both frontend and backend - Docker: 3-service orchestration (frontend, backend, postgres) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
909 B
TypeScript
33 lines
909 B
TypeScript
import { auth } from "@/auth";
|
||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||
|
||
export default async function DashboardPage() {
|
||
const session = await auth();
|
||
const user = session?.user as any;
|
||
|
||
return (
|
||
<div className="space-y-4">
|
||
<h1 className="text-2xl font-bold">欢迎,{user?.name || user?.email}</h1>
|
||
<Card>
|
||
<CardHeader>
|
||
<CardTitle>用户信息</CardTitle>
|
||
</CardHeader>
|
||
<CardContent className="space-y-2 text-sm">
|
||
<p>
|
||
<span className="font-medium">用户名:</span>
|
||
{user?.name}
|
||
</p>
|
||
<p>
|
||
<span className="font-medium">邮箱:</span>
|
||
{user?.email}
|
||
</p>
|
||
<p>
|
||
<span className="font-medium">角色:</span>
|
||
{user?.role}
|
||
</p>
|
||
</CardContent>
|
||
</Card>
|
||
</div>
|
||
);
|
||
}
|