From 70a56dbd39c7d99ff0f1269debf6e4c3cd5aaab4 Mon Sep 17 00:00:00 2001 From: none Date: Tue, 7 Mar 2023 15:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96404=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/error/index.module.less | 4 ++++ src/pages/error/index.tsx | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/pages/error/index.module.less b/src/pages/error/index.module.less index e69de29..6e35a80 100644 --- a/src/pages/error/index.module.less +++ b/src/pages/error/index.module.less @@ -0,0 +1,4 @@ +.main { + width: 100vw; + height: 100vh; +} diff --git a/src/pages/error/index.tsx b/src/pages/error/index.tsx index e05a98f..3ab4378 100644 --- a/src/pages/error/index.tsx +++ b/src/pages/error/index.tsx @@ -1,11 +1,27 @@ +import { Button, Result } from "antd"; import React from "react"; +import { useNavigate } from "react-router-dom"; import styles from "./index.module.less"; export const ErrorPage: React.FC = () => { + const navigate = useNavigate(); + return ( -
-

Oops!

-

路由不存在

-
+ { + navigate("/"); + }} + > + 返回首页 + + } + /> ); };