feat: lighten ai agent admin frontend

This commit is contained in:
2026-06-11 18:03:43 +08:00
parent ecf29e2278
commit 15229cc5ab
316 changed files with 898 additions and 60944 deletions
+4 -21
View File
@@ -39,16 +39,7 @@ function normalizeViewPath(path: string) {
const viewPath = normalizedPath.startsWith('/')
? normalizedPath
: `/${normalizedPath}`;
return viewPath
.replace(/^\/views/, '')
.replace(
/^\/online-dev\/page-render\/index(\.vue)?$/,
'/_core/page-render/index$1',
)
.replace(
/^\/online-development\/page-render\/index(\.vue)?$/,
'/_core/page-render/index$1',
);
return viewPath.replace(/^\/views/, '');
}
function hasPageComponent(
@@ -183,22 +174,14 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
message: `${$t('common.loadingMenu')}...`,
});
// 获取应用上下文
const appContextStore = useAppContextStore();
const menus = appContextStore.appCode
? await getAllMenusApi(appContextStore.appCode)
: await getAllMenusApi();
// 如果是子应用模式,传递 appCode 过滤应用专属菜单
if (appContextStore.appCode) {
const menus = await getAllMenusApi(appContextStore.appCode);
return filterAvailableRoutes(menus, routePageMap, layoutMap);
}
// 主应用模式,不传参数
const menus = await getAllMenusApi();
return filterAvailableRoutes(menus, routePageMap, layoutMap);
},
// 可以指定没有权限跳转403页面
forbiddenComponent,
// 如果 route.meta.menuVisibleWithForbidden = true
layoutMap,
pageMap,
});