feat(web): 搭建 Web 壳层与 UI 包基线
React 19 + Vite 6 + Router 7 + TanStack Query + Zustand;Semi 二次封装与 Remix 图标统一出口;顶部模块 + 左侧功能菜单布局、Cloud Blue 主题、登录页与 401/403/404/500 页面;请求层含 token 注入、单飞刷新与统一错误提示。
This commit is contained in:
1 parent
23067edb8f
commit
073d210a92
51 files changed
+4452
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import { createBrowserRouter } from 'react-router';
|
||||
|
||||
import { AppLayout } from '@/layout/AppLayout';
|
||||
import { ForbiddenPage } from '@/pages/errors/ForbiddenPage';
|
||||
import { NotFoundPage } from '@/pages/errors/NotFoundPage';
|
||||
import { ServerErrorPage } from '@/pages/errors/ServerErrorPage';
|
||||
import { UnauthorizedPage } from '@/pages/errors/UnauthorizedPage';
|
||||
import { ROUTES } from '@/routes';
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: ROUTES.login,
|
||||
lazy: async () => ({
|
||||
Component: (await import('@/pages/login/LoginPage')).default,
|
||||
}),
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
element: <AppLayout />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
lazy: async () => ({
|
||||
Component: (await import('@/pages/home/HomePage')).default,
|
||||
}),
|
||||
},
|
||||
{
|
||||
path: ':moduleKey/:itemKey?',
|
||||
lazy: async () => ({
|
||||
Component: (await import('@/pages/workspace/WorkspacePage')).default,
|
||||
}),
|
||||
},
|
||||
],
|
||||
},
|
||||
{ path: ROUTES.unauthorized, element: <UnauthorizedPage /> },
|
||||
{ path: ROUTES.forbidden, element: <ForbiddenPage /> },
|
||||
{ path: ROUTES.notFound, element: <NotFoundPage /> },
|
||||
{ path: ROUTES.serverError, element: <ServerErrorPage /> },
|
||||
{ path: '*', element: <NotFoundPage /> },
|
||||
]);
|
||||
Reference in new issue
Block a user