diff --git a/src/app/(auth)/unauthorized/page.tsx b/src/app/(auth)/unauthorized/page.tsx new file mode 100644 index 0000000..1ccd41b --- /dev/null +++ b/src/app/(auth)/unauthorized/page.tsx @@ -0,0 +1,41 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { Button } from "@/components/ui/button"; +import { ArrowLeftIcon, HomeIcon } from "lucide-react"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; + +export default function UnauthorizedPage() { + const router = useRouter(); + + const handleGoBack = () => { + router.back(); + }; + + const handleGoHome = () => { + router.push("/"); + }; + + return ( +
+ + + 403 + + +

你无权访问该页面

+
+ + +
+
+
+
+ ); +} diff --git a/src/app/(protected)/unauthorized/page.tsx b/src/app/(protected)/unauthorized/page.tsx deleted file mode 100644 index 52b0671..0000000 --- a/src/app/(protected)/unauthorized/page.tsx +++ /dev/null @@ -1,28 +0,0 @@ -'use client' - -import { Button } from "@/components/ui/button"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { redirect } from "next/navigation"; - - -export default function ForbiddenPage() { - const handleGoBack = () => { - redirect("/") - }; - - return ( -
- - - 403 - - -

你无权访问该页面

- -
-
-
- ); -}