fix build
This commit is contained in:
parent
7ffe8898d9
commit
fae9eebb03
@ -5,6 +5,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { AlertTriangle, ArrowLeft } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { Suspense } from "react"
|
||||
|
||||
const errorMessages: Record<string, string> = {
|
||||
Configuration: "服务器配置错误",
|
||||
@ -13,46 +14,63 @@ const errorMessages: Record<string, string> = {
|
||||
Default: "登录时发生错误",
|
||||
}
|
||||
|
||||
export default function AuthErrorPage() {
|
||||
function AuthErrorContent() {
|
||||
const searchParams = useSearchParams()
|
||||
const error = searchParams.get("error")
|
||||
|
||||
const errorMessage = error && errorMessages[error] ? errorMessages[error] : errorMessages.Default
|
||||
|
||||
return (
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="space-y-1 text-center">
|
||||
<div className="flex justify-center mb-4">
|
||||
<AlertTriangle className="h-12 w-12 text-red-500" />
|
||||
</div>
|
||||
<CardTitle className="text-2xl">登录失败</CardTitle>
|
||||
<CardDescription>
|
||||
{errorMessage}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="text-sm text-muted-foreground text-center">
|
||||
<p>请重新尝试登录,或联系管理员获取帮助。</p>
|
||||
{error && (
|
||||
<p className="mt-2">错误代码: {error}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button asChild variant="outline" className="flex-1">
|
||||
<Link href="/">
|
||||
<ArrowLeft className="mr-2 h-4 w-4" />
|
||||
返回首页
|
||||
</Link>
|
||||
</Button>
|
||||
<Button asChild className="flex-1">
|
||||
<Link href="/auth/signin">
|
||||
重新登录
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
|
||||
export default function AuthErrorPage() {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gray-50">
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="space-y-1 text-center">
|
||||
<div className="flex justify-center mb-4">
|
||||
<AlertTriangle className="h-12 w-12 text-red-500" />
|
||||
</div>
|
||||
<CardTitle className="text-2xl">登录失败</CardTitle>
|
||||
<CardDescription>
|
||||
{errorMessage}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="text-sm text-muted-foreground text-center">
|
||||
<p>请重新尝试登录,或联系管理员获取帮助。</p>
|
||||
{error && (
|
||||
<p className="mt-2">错误代码: {error}</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button asChild variant="outline" className="flex-1">
|
||||
<Link href="/">
|
||||
<ArrowLeft className="mr-2 h-4 w-4" />
|
||||
返回首页
|
||||
</Link>
|
||||
</Button>
|
||||
<Button asChild className="flex-1">
|
||||
<Link href="/auth/signin">
|
||||
重新登录
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Suspense fallback={
|
||||
<Card className="w-full max-w-md">
|
||||
<CardHeader className="space-y-1 text-center">
|
||||
<div className="flex justify-center mb-4">
|
||||
<AlertTriangle className="h-12 w-12 text-red-500" />
|
||||
</div>
|
||||
<CardTitle className="text-2xl">加载中...</CardTitle>
|
||||
</CardHeader>
|
||||
</Card>
|
||||
}>
|
||||
<AuthErrorContent />
|
||||
</Suspense>
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user