2024-07-11 11:00:51 +08:00
|
|
|
import {
|
|
|
|
createBrowserRouter
|
|
|
|
} from "react-router-dom";
|
|
|
|
import MainPage from "../app/main/page";
|
2024-07-22 10:07:05 +08:00
|
|
|
import ErrorPage from "../app/error";
|
|
|
|
import LayoutPage from "../app/layout";
|
2024-09-09 18:48:07 +08:00
|
|
|
import LoginPage from "../app/login";
|
|
|
|
import WithAuth from "../components/auth/with-auth";
|
2024-07-22 10:07:05 +08:00
|
|
|
|
2024-07-11 11:00:51 +08:00
|
|
|
export const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: "/",
|
2024-07-22 10:07:05 +08:00
|
|
|
element: <LayoutPage></LayoutPage>,
|
2024-07-11 11:00:51 +08:00
|
|
|
errorElement: <ErrorPage></ErrorPage>,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
index: true,
|
2024-09-09 18:48:07 +08:00
|
|
|
element: <WithAuth><MainPage></MainPage></WithAuth>
|
2024-07-11 11:00:51 +08:00
|
|
|
}
|
2024-09-09 18:48:07 +08:00
|
|
|
],
|
2024-07-11 11:00:51 +08:00
|
|
|
},
|
2024-09-09 18:48:07 +08:00
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
element: <LoginPage></LoginPage>
|
|
|
|
}
|
|
|
|
|
2024-07-11 11:00:51 +08:00
|
|
|
]);
|