🎨 清理多余文件,修改项目model
This commit is contained in:
@@ -20,4 +20,10 @@ export default defineConfig([
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/router/pages/**/page.tsx'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': 'off',
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
@@ -6,59 +6,8 @@ import { buildFullMenus, findDefaultRoute, flattenMenus, isExternalMenu } from '
|
||||
import { useAuthStore } from '@/store/auth'
|
||||
import { LoginPage } from '@/features/auth/LoginPage'
|
||||
import { AdminShell } from '@/features/layout/AdminShell'
|
||||
import { DashboardPage } from '@/features/dashboard/DashboardPage'
|
||||
import { ModuleLandingPage } from '@/features/discovery/ModuleLandingPage'
|
||||
import { ProfilePage } from '@/features/person/ProfilePage'
|
||||
import { ServerStatePage } from '@/features/server/ServerStatePage'
|
||||
import { UserManagementPage } from '@/features/users/UserManagementPage'
|
||||
import { RoleManagementPage } from '@/features/roles/RoleManagementPage'
|
||||
import { MenuManagementPage } from '@/features/menus/MenuManagementPage'
|
||||
import { ApiManagementPage } from '@/features/apis/ApiManagementPage'
|
||||
import { DictionaryManagementPage } from '@/features/dictionaries/DictionaryManagementPage'
|
||||
import { ParamsManagementPage } from '@/features/params/ParamsManagementPage'
|
||||
import { LoginLogPage } from '@/features/logs/LoginLogPage'
|
||||
import { OperationLogPage } from '@/features/logs/OperationLogPage'
|
||||
import { SystemConfigPage } from '@/features/system/SystemConfigPage'
|
||||
import { ApiTokenPage } from '@/features/tokens/ApiTokenPage'
|
||||
import { ErrorLogPage } from '@/features/errors/ErrorLogPage'
|
||||
import { MediaLibraryPage } from '@/features/media/MediaLibraryPage'
|
||||
import { BreakpointPage } from '@/features/breakpoint/BreakpointPage'
|
||||
import { McpTestPage } from '@/features/mcp/McpTestPage'
|
||||
import { McpToolPage } from '@/features/mcp/McpToolPage'
|
||||
|
||||
type AppRoute = {
|
||||
path: string
|
||||
menuName: string
|
||||
element: React.ReactNode
|
||||
}
|
||||
|
||||
const appRoutes: AppRoute[] = [
|
||||
{ path: 'dashboard', menuName: 'dashboard', element: <DashboardPage /> },
|
||||
{ path: 'about', menuName: 'about', element: <ModuleLandingPage moduleName="about" /> },
|
||||
{ path: 'admin', menuName: 'superAdmin', element: <ModuleLandingPage moduleName="superAdmin" /> },
|
||||
{ path: 'admin/authority', menuName: 'authority', element: <RoleManagementPage /> },
|
||||
{ path: 'admin/menu', menuName: 'menu', element: <MenuManagementPage /> },
|
||||
{ path: 'admin/api', menuName: 'api', element: <ApiManagementPage /> },
|
||||
{ path: 'admin/user', menuName: 'user', element: <UserManagementPage /> },
|
||||
{ path: 'admin/dictionary', menuName: 'dictionary', element: <DictionaryManagementPage /> },
|
||||
{ path: 'admin/operation', menuName: 'operation', element: <OperationLogPage /> },
|
||||
{ path: 'admin/sysParams', menuName: 'sysParams', element: <ParamsManagementPage /> },
|
||||
{ path: 'admin/system', menuName: 'system', element: <SystemConfigPage /> },
|
||||
{ path: 'admin/apiToken', menuName: 'apiToken', element: <ApiTokenPage /> },
|
||||
{ path: 'admin/loginLog', menuName: 'loginLog', element: <LoginLogPage /> },
|
||||
{ path: 'admin/sysVersion', menuName: 'sysVersion', element: <ModuleLandingPage moduleName="sysVersion" /> },
|
||||
{ path: 'admin/sysError', menuName: 'sysError', element: <ErrorLogPage /> },
|
||||
{ path: 'common', menuName: 'common', element: <ModuleLandingPage moduleName="common" /> },
|
||||
{ path: 'common/upload', menuName: 'upload', element: <MediaLibraryPage /> },
|
||||
{ path: 'common/breakpoint', menuName: 'breakpoint', element: <BreakpointPage /> },
|
||||
{ path: 'systemTools', menuName: 'systemTools', element: <ModuleLandingPage moduleName="systemTools" /> },
|
||||
{ path: 'systemTools/formCreate', menuName: 'formCreate', element: <ModuleLandingPage moduleName="formCreate" /> },
|
||||
{ path: 'systemTools/exportTemplate', menuName: 'exportTemplate', element: <ModuleLandingPage moduleName="exportTemplate" /> },
|
||||
{ path: 'systemTools/mcpTest', menuName: 'mcpTest', element: <McpTestPage /> },
|
||||
{ path: 'systemTools/mcpTool', menuName: 'mcpTool', element: <McpToolPage /> },
|
||||
{ path: 'person', menuName: 'person', element: <ProfilePage /> },
|
||||
{ path: 'state', menuName: 'state', element: <ServerStatePage /> },
|
||||
]
|
||||
import { appRoutes } from '@/router/fsRoutes'
|
||||
import type { AppRoute } from '@/router/routeTypes'
|
||||
|
||||
function BootstrapGate() {
|
||||
const navigate = useNavigate()
|
||||
@@ -158,7 +107,8 @@ function RouteGuard({ route }: { route: AppRoute }) {
|
||||
)
|
||||
}
|
||||
|
||||
return <>{route.element}</>
|
||||
const RouteComponent = route.component
|
||||
return <RouteComponent />
|
||||
}
|
||||
|
||||
function LayoutFrame() {
|
||||
|
||||
@@ -23,5 +23,35 @@ export default defineConfig({
|
||||
},
|
||||
build: {
|
||||
chunkSizeWarningLimit: 1500,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (!id.includes('node_modules')) {
|
||||
return
|
||||
}
|
||||
|
||||
if (id.includes('antd') || id.includes('@ant-design') || id.includes('/rc-')) {
|
||||
return 'antd-vendor'
|
||||
}
|
||||
|
||||
if (id.includes('recharts') || id.includes('/d3-')) {
|
||||
return 'charts-vendor'
|
||||
}
|
||||
|
||||
if (id.includes('react') || id.includes('scheduler')) {
|
||||
return 'react-vendor'
|
||||
}
|
||||
|
||||
if (
|
||||
id.includes('@tanstack') ||
|
||||
id.includes('axios') ||
|
||||
id.includes('zustand') ||
|
||||
id.includes('dayjs')
|
||||
) {
|
||||
return 'app-vendor'
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user