Skip to content

Commit ad4f306

Browse files
committed
feat: 删除首页页面路由 用loader进行跳转
1 parent cbbc566 commit ad4f306

File tree

3 files changed

+2
-67
lines changed

3 files changed

+2
-67
lines changed

src/router/elegant/imports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const pages = {
3131
"404": () => import("@/pages/_builtin/404/index.tsx"),
3232
"500": () => import("@/pages/_builtin/500/index.tsx"),
3333
"iframe-page": () => import("@/pages/_builtin/iframe-page/index.tsx"),
34-
"root": () => import("@/pages/index.tsx"),
3534
};
3635

3736
export const errors = {

src/router/index.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
import { createBrowserRouter } from 'react-router';
1+
import { authRoutes, constantRoutes as routes } from './routes';
22

3-
import { routes } from './routes';
4-
5-
export { routes };
6-
7-
export const router = createBrowserRouter(routes, { basename: import.meta.env.VITE_BASE_URL });
8-
9-
/** create routes when the auth route mode is static */
10-
export function createStaticRoutes() {
11-
const constantRoutes: ElegantRoute[] = [];
12-
13-
const authRoutes: ElegantRoute[] = [];
14-
15-
[...customRoutes, ...generatedRoutes].forEach(item => {
16-
if (item.meta?.constant) {
17-
constantRoutes.push(item);
18-
} else {
19-
authRoutes.push(item);
20-
}
21-
});
22-
23-
return {
24-
authRoutes,
25-
constantRoutes
26-
};
27-
}
3+
export { authRoutes, routes };

src/store/slice/route/index.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)