WebUI 前端 & 后端超级大重构

This commit is contained in:
DrSmoothl
2026-03-14 21:06:36 +08:00
parent 6ca5a2939e
commit 172615f18a
69 changed files with 3128 additions and 6581 deletions

View File

@@ -24,7 +24,6 @@ import { PluginMirrorsPage } from './routes/plugin-mirrors'
import { PluginDetailPage } from './routes/plugin-detail'
import { ChatPage } from './routes/chat/index'
import { WebUIFeedbackSurveyPage, MaiBotFeedbackSurveyPage } from './routes/survey'
import { AnnualReportPage } from './routes/annual-report'
import PackMarketPage from './routes/config/pack-market'
import PackDetailPage from './routes/config/pack-detail'
import { Layout } from './components/layout'
@@ -241,13 +240,6 @@ const maibotFeedbackSurveyRoute = createRoute({
component: MaiBotFeedbackSurveyPage,
})
// 年度报告路由
const annualReportRoute = createRoute({
getParentRoute: () => protectedRoute,
path: '/annual-report',
component: AnnualReportPage,
})
// 404 路由
const notFoundRoute = createRoute({
getParentRoute: () => rootRoute,
@@ -284,11 +276,23 @@ const routeTree = rootRoute.addChildren([
packDetailRoute,
webuiFeedbackSurveyRoute,
maibotFeedbackSurveyRoute,
annualReportRoute,
]),
notFoundRoute,
])
type RouteNode = {
fullPath?: string
children?: RouteNode[]
}
function collectRoutePaths(node: RouteNode): string[] {
const currentPath = node.fullPath ? [node.fullPath] : []
const childPaths = node.children?.flatMap(collectRoutePaths) ?? []
return [...currentPath, ...childPaths]
}
export const registeredRoutePaths = new Set(collectRoutePaths(routeTree as RouteNode))
// 创建路由器
export const router = createRouter({
routeTree,