From fb2877ff2cdd3d23cf54b111e6b1ed678549cca9 Mon Sep 17 00:00:00 2001 From: wangxuefeng Date: Tue, 25 Mar 2025 15:53:55 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E7=94=A8=E6=88=B7=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=80=83=E8=99=91=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/platform/src/router/guard.ts | 3 +- apps/platform/src/router/routes/core.ts | 5 +- .../platform/src/router/routes/modules/acl.ts | 3 +- .../src/router/routes/modules/example.ts | 53 +++++++++++++++++++ .../src/router/routes/modules/micro.ts | 1 + 5 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 apps/platform/src/router/routes/modules/example.ts diff --git a/apps/platform/src/router/guard.ts b/apps/platform/src/router/guard.ts index 41391ed..53b70f4 100644 --- a/apps/platform/src/router/guard.ts +++ b/apps/platform/src/router/guard.ts @@ -113,7 +113,8 @@ function setupAccessGuard(router: Router) { // ? userInfo.homePath || DEFAULT_HOME_PATH // : to.fullPath)) as string; - const redirectPath = DEFAULT_HOME_PATH; + // const redirectPath = DEFAULT_HOME_PATH; + const redirectPath = '/example/echart'; return { ...router.resolve(decodeURIComponent(redirectPath)), diff --git a/apps/platform/src/router/routes/core.ts b/apps/platform/src/router/routes/core.ts index d936aa0..c4b60ce 100644 --- a/apps/platform/src/router/routes/core.ts +++ b/apps/platform/src/router/routes/core.ts @@ -1,7 +1,5 @@ import type { RouteRecordRaw } from 'vue-router'; -import { DEFAULT_HOME_PATH } from '@vben/constants'; - import { BasicLayout } from '#/layouts'; /** 全局404页面 */ @@ -32,7 +30,8 @@ const coreRoutes: RouteRecordRaw[] = [ }, name: 'Root', path: '/', - redirect: DEFAULT_HOME_PATH, + // redirect: DEFAULT_HOME_PATH, + redirect: '/example/echart', children: [], }, // { diff --git a/apps/platform/src/router/routes/modules/acl.ts b/apps/platform/src/router/routes/modules/acl.ts index edc6b00..8ca19da 100644 --- a/apps/platform/src/router/routes/modules/acl.ts +++ b/apps/platform/src/router/routes/modules/acl.ts @@ -2,7 +2,7 @@ import type { RouteRecordRaw } from 'vue-router'; import WujieVueRendererAdapter from '@sy/wujie-vue3-renderer-adapter'; -import { LOW_CODE_PROJECT_ID, VITE_RENDERER_URL } from '#/constants'; +import { isDevMode, LOW_CODE_PROJECT_ID, VITE_RENDERER_URL } from '#/constants'; const moduleName = 'acl'; @@ -12,6 +12,7 @@ const routes: Array = [ name: moduleName, redirect: '/acl/list', meta: { + hideInMenu: !isDevMode, title: '用户管理', icon: 'ant-design:user-outlined', }, diff --git a/apps/platform/src/router/routes/modules/example.ts b/apps/platform/src/router/routes/modules/example.ts new file mode 100644 index 0000000..9311b45 --- /dev/null +++ b/apps/platform/src/router/routes/modules/example.ts @@ -0,0 +1,53 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import WujieVueRendererAdapter from '@sy/wujie-vue3-renderer-adapter'; + +import { VITE_RENDERER_URL } from '#/constants'; + +const routes: Array = [ + { + path: '/example', + name: 'Example', + redirect: '/example/echart', + meta: { + title: '示例', + icon: 'ant-design:edit-outlined', + }, + children: [ + { + path: '/example/echart', + name: 'Echart', + meta: { + // 移除 hideInMenu: true 或将其设置为 false + hideInMenu: false, + title: 'Echart 图表', + icon: 'ant-design:list', + }, + component: WujieVueRendererAdapter, + props: { + url: `${VITE_RENDERER_URL}`, + fileId: '13a9dmbz', + projectId: 22, + }, + }, + { + path: '/example/table', + name: 'Table', + meta: { + // 移除 hideInMenu: true 或将其设置为 false + hideInMenu: false, + title: 'Table 表格', + icon: 'ant-design:list', + }, + component: WujieVueRendererAdapter, + props: { + url: `${VITE_RENDERER_URL}`, + fileId: '13a9dmbz', + projectId: 22, + }, + }, + ], + }, +]; + +export default routes; diff --git a/apps/platform/src/router/routes/modules/micro.ts b/apps/platform/src/router/routes/modules/micro.ts index c0fdc66..281601e 100644 --- a/apps/platform/src/router/routes/modules/micro.ts +++ b/apps/platform/src/router/routes/modules/micro.ts @@ -16,6 +16,7 @@ const routes: RouteRecordRaw[] = [ meta: { title: '微应用容器', icon: 'ant-design:appstore-outlined', + hideInMenu: !isDevMode, }, children: [ {