feat: lighten ai agent admin frontend
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
// import { $t } from '#/locales';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
// {
|
||||
// meta: {
|
||||
// icon: 'lucide:message-square',
|
||||
// title: $t('chat.title'),
|
||||
// noBasicLayout: true,
|
||||
// },
|
||||
// name: 'ChatIndex',
|
||||
// path: '/chat',
|
||||
// component: () => import('#/views/_core/chat/index.vue'),
|
||||
// },
|
||||
];
|
||||
|
||||
export default routes;
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
const routes: RouteRecordRaw[] = [];
|
||||
|
||||
export default routes;
|
||||
Reference in New Issue
Block a user