From 0bf57e8b6c467a0e2a6d299442110a4cbc72cc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 2 Mar 2023 14:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=B8=A2=E5=A4=B1=E9=A1=B5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/error/Error.module.css | 0 src/pages/error/{index.tsx => Error.tsx} | 1 + src/pages/error/index.ts | 1 + src/pages/index.ts | 3 ++- src/router/routes.tsx | 6 +++++- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 src/pages/error/Error.module.css rename src/pages/error/{index.tsx => Error.tsx} (81%) create mode 100644 src/pages/error/index.ts diff --git a/src/pages/error/Error.module.css b/src/pages/error/Error.module.css new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/error/index.tsx b/src/pages/error/Error.tsx similarity index 81% rename from src/pages/error/index.tsx rename to src/pages/error/Error.tsx index 96d667c..ed12866 100644 --- a/src/pages/error/index.tsx +++ b/src/pages/error/Error.tsx @@ -1,4 +1,5 @@ import React from "react"; +import styles from "./Error.module.css"; export const ErrorPage: React.FC = () => { return ( diff --git a/src/pages/error/index.ts b/src/pages/error/index.ts new file mode 100644 index 0000000..3479ac1 --- /dev/null +++ b/src/pages/error/index.ts @@ -0,0 +1 @@ +export * from "./Error"; \ No newline at end of file diff --git a/src/pages/index.ts b/src/pages/index.ts index 324e145..493b21e 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,3 +1,4 @@ export * from "./home"; export * from "./login"; -export * from "./dashboard"; \ No newline at end of file +export * from "./dashboard"; +export * from "./error"; \ No newline at end of file diff --git a/src/router/routes.tsx b/src/router/routes.tsx index a3681d4..e353e9f 100644 --- a/src/router/routes.tsx +++ b/src/router/routes.tsx @@ -1,6 +1,6 @@ import React from "react"; import { RouteObject } from "react-router-dom"; -import { Login, HomePage, Dashboard } from "../pages"; +import { Login, HomePage, Dashboard, ErrorPage } from "../pages"; const routes: RouteObject[] = [ { @@ -17,6 +17,10 @@ const routes: RouteObject[] = [ path: "/login", element: , }, + { + path: "*", + element: , + }, ]; export default routes;