chore: 容器框架升级,修复项目命令行异常问题
This commit is contained in:
94
apps/platform/src/router/routes/core.ts
Normal file
94
apps/platform/src/router/routes/core.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { DEFAULT_HOME_PATH } from '@vben/constants';
|
||||
|
||||
import { BasicLayout } from '#/layouts';
|
||||
|
||||
/** 全局404页面 */
|
||||
const fallbackNotFoundRoute: RouteRecordRaw = {
|
||||
component: () => import('#/views/_core/fallback/not-found.vue'),
|
||||
meta: {
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
title: '404',
|
||||
},
|
||||
name: 'FallbackNotFound',
|
||||
path: '/:path(.*)*',
|
||||
};
|
||||
|
||||
/** 基本路由,这些路由是必须存在的 */
|
||||
const coreRoutes: RouteRecordRaw[] = [
|
||||
/**
|
||||
* 根路由
|
||||
* 使用基础布局,作为所有页面的父级容器,子级就不必配置BasicLayout。
|
||||
* 此路由必须存在,且不应修改
|
||||
*/
|
||||
{
|
||||
component: BasicLayout,
|
||||
meta: {
|
||||
hideInBreadcrumb: true,
|
||||
title: 'Root',
|
||||
},
|
||||
name: 'Root',
|
||||
path: '/',
|
||||
redirect: DEFAULT_HOME_PATH,
|
||||
children: [],
|
||||
},
|
||||
// {
|
||||
// component: AuthPageLayout,
|
||||
// meta: {
|
||||
// hideInTab: true,
|
||||
// title: 'Authentication',
|
||||
// },
|
||||
// name: 'Authentication',
|
||||
// path: '/auth',
|
||||
// redirect: LOGIN_PATH,
|
||||
// children: [
|
||||
// {
|
||||
// name: 'Login',
|
||||
// path: 'login',
|
||||
// component: Login,
|
||||
// meta: {
|
||||
// title: $t('page.auth.login'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'CodeLogin',
|
||||
// path: 'code-login',
|
||||
// component: () => import('#/views/_core/authentication/code-login.vue'),
|
||||
// meta: {
|
||||
// title: $t('page.auth.codeLogin'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'QrCodeLogin',
|
||||
// path: 'qrcode-login',
|
||||
// component: () =>
|
||||
// import('#/views/_core/authentication/qrcode-login.vue'),
|
||||
// meta: {
|
||||
// title: $t('page.auth.qrcodeLogin'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'ForgetPassword',
|
||||
// path: 'forget-password',
|
||||
// component: () =>
|
||||
// import('#/views/_core/authentication/forget-password.vue'),
|
||||
// meta: {
|
||||
// title: $t('page.auth.forgetPassword'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'Register',
|
||||
// path: 'register',
|
||||
// component: () => import('#/views/_core/authentication/register.vue'),
|
||||
// meta: {
|
||||
// title: $t('page.auth.register'),
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
];
|
||||
|
||||
export { coreRoutes, fallbackNotFoundRoute };
|
||||
37
apps/platform/src/router/routes/index.ts
Normal file
37
apps/platform/src/router/routes/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { mergeRouteModules, traverseTreeValues } from '@vben/utils';
|
||||
|
||||
import { coreRoutes, fallbackNotFoundRoute } from './core';
|
||||
|
||||
const dynamicRouteFiles = import.meta.glob('./modules/**/*.ts', {
|
||||
eager: true,
|
||||
});
|
||||
|
||||
// 有需要可以自行打开注释,并创建文件夹
|
||||
// const externalRouteFiles = import.meta.glob('./external/**/*.ts', { eager: true });
|
||||
// const staticRouteFiles = import.meta.glob('./static/**/*.ts', { eager: true });
|
||||
|
||||
/** 动态路由 */
|
||||
const dynamicRoutes: RouteRecordRaw[] = mergeRouteModules(dynamicRouteFiles);
|
||||
|
||||
/** 外部路由列表,访问这些页面可以不需要Layout,可能用于内嵌在别的系统(不会显示在菜单中) */
|
||||
// const externalRoutes: RouteRecordRaw[] = mergeRouteModules(externalRouteFiles);
|
||||
// const staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
|
||||
const staticRoutes: RouteRecordRaw[] = [];
|
||||
const externalRoutes: RouteRecordRaw[] = [];
|
||||
|
||||
/** 路由列表,由基本路由、外部路由和404兜底路由组成
|
||||
* 无需走权限验证(会一直显示在菜单中) */
|
||||
const routes: RouteRecordRaw[] = [
|
||||
...coreRoutes,
|
||||
...externalRoutes,
|
||||
fallbackNotFoundRoute,
|
||||
];
|
||||
|
||||
/** 基本路由列表,这些路由不需要进入权限拦截 */
|
||||
const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
|
||||
|
||||
/** 有权限校验的路由列表,包含动态路由和静态路由 */
|
||||
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
||||
export { accessRoutes, coreRouteNames, routes };
|
||||
45
apps/platform/src/router/routes/modules/acl.ts
Normal file
45
apps/platform/src/router/routes/modules/acl.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { VITE_RENDERER_URL } from '#/constants';
|
||||
import {
|
||||
LOW_CODE_APPLICATION_ID,
|
||||
LOW_CODE_PROJECT_ID,
|
||||
} from '#/constants/low-code';
|
||||
|
||||
const moduleName = 'acl';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/acl',
|
||||
name: moduleName,
|
||||
redirect: '/acl/list',
|
||||
meta: {
|
||||
title: '权限管理',
|
||||
icon: 'ant-design:user-outlined',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: `${moduleName}-list`,
|
||||
meta: {
|
||||
title: '权限列表',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:list',
|
||||
app: {
|
||||
url: VITE_RENDERER_URL,
|
||||
name: 'y-code-platform-project-list',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
// degrade: true,
|
||||
applicationId: LOW_CODE_APPLICATION_ID,
|
||||
projectId: LOW_CODE_PROJECT_ID,
|
||||
fileId: '1hsd0407hf',
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
41
apps/platform/src/router/routes/modules/application.ts
Normal file
41
apps/platform/src/router/routes/modules/application.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { VITE_RENDERER_URL } from '#/constants';
|
||||
|
||||
// 微前端路由
|
||||
const moduleName = 'application';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/application',
|
||||
name: moduleName,
|
||||
meta: {
|
||||
title: '应用管理',
|
||||
icon: 'ant-design:appstore-outlined',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: `${moduleName}-list`,
|
||||
meta: {
|
||||
title: '应用列表',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:list',
|
||||
app: {
|
||||
url: VITE_RENDERER_URL,
|
||||
name: 'y-code-platform-application-list',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
// degrade: true,
|
||||
applicationId: 0,
|
||||
projectId: 4,
|
||||
fileId: 'b91n1y9yr',
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
38
apps/platform/src/router/routes/modules/dashboard.ts
Normal file
38
apps/platform/src/router/routes/modules/dashboard.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
meta: {
|
||||
icon: 'lucide:layout-dashboard',
|
||||
order: -1,
|
||||
title: $t('page.dashboard.title'),
|
||||
},
|
||||
name: 'Dashboard',
|
||||
path: '/dashboard',
|
||||
children: [
|
||||
{
|
||||
name: 'Analytics',
|
||||
path: '/analytics',
|
||||
component: () => import('#/views/dashboard/analytics/index.vue'),
|
||||
meta: {
|
||||
affixTab: true,
|
||||
icon: 'lucide:area-chart',
|
||||
title: $t('page.dashboard.analytics'),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Workspace',
|
||||
path: '/workspace',
|
||||
component: () => import('#/views/dashboard/workspace/index.vue'),
|
||||
meta: {
|
||||
icon: 'carbon:workspace',
|
||||
title: $t('page.dashboard.workspace'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
56
apps/platform/src/router/routes/modules/micro.ts
Normal file
56
apps/platform/src/router/routes/modules/micro.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { VITE_DESIGNER_URL, VITE_V1_URL } from '#/constants';
|
||||
|
||||
const moduleName = 'micro';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/micro',
|
||||
name: moduleName,
|
||||
meta: {
|
||||
title: '微应用容器',
|
||||
icon: 'ant-design:appstore-outlined',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'designer',
|
||||
name: `${moduleName}-designer`,
|
||||
meta: {
|
||||
title: '低代码编辑器',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:edit-outlined',
|
||||
app: {
|
||||
url: VITE_DESIGNER_URL,
|
||||
name: 'y-code-designer',
|
||||
projectId: 4,
|
||||
sync: true,
|
||||
alive: true,
|
||||
degrade: true,
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'y-code-v1',
|
||||
name: `${moduleName}-y-code-v1`,
|
||||
meta: {
|
||||
title: '悦码 1.0',
|
||||
keepAlive: true,
|
||||
// hideInMenu: true,
|
||||
icon: 'ant-design:delete-outlined',
|
||||
app: {
|
||||
url: VITE_V1_URL,
|
||||
name: 'y-code-v1',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
degrade: true,
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
65
apps/platform/src/router/routes/modules/project.ts
Normal file
65
apps/platform/src/router/routes/modules/project.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { VITE_RENDERER_URL } from '#/constants';
|
||||
import {
|
||||
LOW_CODE_APPLICATION_ID,
|
||||
LOW_CODE_PROJECT_ID,
|
||||
} from '#/constants/low-code';
|
||||
|
||||
// 微前端路由
|
||||
const moduleName = 'project';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/project',
|
||||
name: moduleName,
|
||||
meta: {
|
||||
title: '项目管理',
|
||||
icon: 'ant-design:appstore-outlined',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: `${moduleName}-list`,
|
||||
meta: {
|
||||
title: '项目列表',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:list',
|
||||
app: {
|
||||
url: VITE_RENDERER_URL,
|
||||
name: 'y-code-platform-project-list',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
// degrade: true,
|
||||
applicationId: LOW_CODE_APPLICATION_ID,
|
||||
projectId: LOW_CODE_PROJECT_ID,
|
||||
fileId: '4g4mz6qi8u',
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
{
|
||||
path: 'file',
|
||||
name: `${moduleName}-file`,
|
||||
meta: {
|
||||
title: 'dsl 文件列表',
|
||||
keepAlive: true,
|
||||
icon: 'ant-design:file',
|
||||
app: {
|
||||
url: VITE_RENDERER_URL,
|
||||
name: 'y-code-platform-project-file',
|
||||
// sync: true,
|
||||
// alive: true,
|
||||
// degrade: true,
|
||||
applicationId: LOW_CODE_APPLICATION_ID,
|
||||
projectId: LOW_CODE_PROJECT_ID,
|
||||
fileId: '7pftwojzu',
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
42
apps/platform/src/router/routes/modules/static-file.ts
Normal file
42
apps/platform/src/router/routes/modules/static-file.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { VITE_RENDERER_URL } from '#/constants';
|
||||
import {
|
||||
LOW_CODE_APPLICATION_ID,
|
||||
LOW_CODE_PROJECT_ID,
|
||||
} from '#/constants/low-code';
|
||||
|
||||
// 微前端路由
|
||||
const moduleName = 'static-file';
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/static-file',
|
||||
name: moduleName,
|
||||
meta: {
|
||||
title: '静态文件管理',
|
||||
icon: 'ant-design:file',
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: `${moduleName}-list`,
|
||||
meta: {
|
||||
title: '静态文件列表',
|
||||
keepAlive: false,
|
||||
icon: 'ant-design:file',
|
||||
app: {
|
||||
url: VITE_RENDERER_URL,
|
||||
name: 'y-code-platform-application-list',
|
||||
applicationId: LOW_CODE_APPLICATION_ID,
|
||||
projectId: LOW_CODE_PROJECT_ID,
|
||||
fileId: '7pfr394d6',
|
||||
},
|
||||
},
|
||||
component: () => import('#/components/renderer-adapter/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
72
apps/platform/src/router/routes/modules/vben.ts
Normal file
72
apps/platform/src/router/routes/modules/vben.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
// {
|
||||
// meta: {
|
||||
// badgeType: 'dot',
|
||||
// icon: VBEN_LOGO_URL,
|
||||
// order: 9998,
|
||||
// title: $t('demos.vben.title'),
|
||||
// },
|
||||
// name: 'VbenProject',
|
||||
// path: '/vben-admin',
|
||||
// children: [
|
||||
// {
|
||||
// name: 'VbenDocument',
|
||||
// path: '/vben-admin/document',
|
||||
// component: IFrameView,
|
||||
// meta: {
|
||||
// icon: 'lucide:book-open-text',
|
||||
// link: VBEN_DOC_URL,
|
||||
// title: $t('demos.vben.document'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'VbenGithub',
|
||||
// path: '/vben-admin/github',
|
||||
// component: IFrameView,
|
||||
// meta: {
|
||||
// icon: 'mdi:github',
|
||||
// link: VBEN_GITHUB_URL,
|
||||
// title: 'Github',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'VbenNaive',
|
||||
// path: '/vben-admin/naive',
|
||||
// component: IFrameView,
|
||||
// meta: {
|
||||
// badgeType: 'dot',
|
||||
// icon: 'logos:naiveui',
|
||||
// link: VBEN_NAIVE_PREVIEW_URL,
|
||||
// title: $t('demos.vben.naive-ui'),
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: 'VbenAntd',
|
||||
// path: '/vben-admin/antd',
|
||||
// component: IFrameView,
|
||||
// meta: {
|
||||
// badgeType: 'dot',
|
||||
// icon: SvgAntdvLogoIcon,
|
||||
// link: VBEN_ANT_PREVIEW_URL,
|
||||
// title: $t('demos.vben.antdv'),
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
name: 'VbenAbout',
|
||||
path: '/vben-admin/about',
|
||||
component: () => import('#/views/_core/about/index.vue'),
|
||||
meta: {
|
||||
icon: 'lucide:copyright',
|
||||
title: $t('demos.vben.about'),
|
||||
order: 9999,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
Reference in New Issue
Block a user