diff --git a/apps/web-antd/.env b/apps/web-antd/.env index dca9fe050..a0bfde11e 100644 --- a/apps/web-antd/.env +++ b/apps/web-antd/.env @@ -1,5 +1,5 @@ # 应用标题 -VITE_APP_TITLE=摄像头管理系统 +VITE_APP_TITLE=芋道管理系统 # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 VITE_APP_NAMESPACE=yudao-vben-antd @@ -11,7 +11,7 @@ VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key VITE_NITRO_MOCK=false # 租户开关 -VITE_APP_TENANT_ENABLE=false +VITE_APP_TENANT_ENABLE=true # 验证码的开关 VITE_APP_CAPTCHA_ENABLE=false @@ -26,7 +26,7 @@ VITE_APP_BAIDU_CODE = e98f2eab6ceb8688bc6d8fc5332ff093 VITE_GOVIEW_URL='http://127.0.0.1:3000' # API 加解密 -VITE_APP_API_ENCRYPT_ENABLE = false +VITE_APP_API_ENCRYPT_ENABLE = true VITE_APP_API_ENCRYPT_HEADER = X-Api-Encrypt VITE_APP_API_ENCRYPT_ALGORITHM = AES VITE_APP_API_ENCRYPT_REQUEST_KEY = 52549111389893486934626385991395 diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts index 9cf7883e4..dcef71175 100644 --- a/apps/web-antd/src/store/auth.ts +++ b/apps/web-antd/src/store/auth.ts @@ -137,48 +137,12 @@ export const useAuthStore = defineStore('auth', () => { // userStore userStore.setUserInfo(authPermissionInfo.user); userStore.setUserRoles(authPermissionInfo.roles); - // accessStore - 隐藏不需要的菜单项 + 重命名菜单 - const processedMenus = renameMenuItems(hideMenuItems(authPermissionInfo.menus)); - accessStore.setAccessMenus(processedMenus); + // accessStore + accessStore.setAccessMenus(authPermissionInfo.menus); accessStore.setAccessCodes(authPermissionInfo.permissions); return authPermissionInfo; } - /** 递归标记菜单为隐藏(visible=false),保留路由可直接访问 */ - function hideMenuItems(menus: any[]): any[] { - // 需要从侧边栏隐藏的菜单路径(ROI 区域配置已整合到摄像头管理中) - const hiddenPaths = new Set(['roi']); - const hiddenNameKeywords = ['ROI', 'roi']; - return menus.map((menu) => { - const shouldHide = - hiddenPaths.has(menu.path) || - (menu.name && - hiddenNameKeywords.some((kw: string) => menu.name.includes(kw))); - return { - ...menu, - visible: shouldHide ? false : menu.visible, - children: menu.children ? hideMenuItems(menu.children) : menu.children, - }; - }); - } - - /** 递归重命名菜单项 */ - function renameMenuItems(menus: any[]): any[] { - const renameMap: Record = { - '摄像头告警汇总': '告警看板', - '告警汇总': '告警看板', - }; - return menus.map((menu) => { - const newName = menu.name && renameMap[menu.name]; - return { - ...menu, - name: newName || menu.name, - meta: newName && menu.meta ? { ...menu.meta, title: newName } : menu.meta, - children: menu.children ? renameMenuItems(menu.children) : menu.children, - }; - }); - } - function $reset() { loginLoading.value = false; } diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index 14e5a9076..8a768c7a8 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -69,39 +69,12 @@ export default defineConfig(async () => { path.replace('/admin-api/aiot/device', '/api/ai'), }, - // ==================== 系统基础路由 ==================== - - // 认证相关接口 -> 告警平台(测试阶段提供模拟认证) - '/admin-api/system/auth': { - changeOrigin: true, - target: 'http://127.0.0.1:8000', - ws: true, - }, - // 租户相关接口 -> 告警平台(测试阶段返回默认值) - '/admin-api/system/tenant': { - changeOrigin: true, - target: 'http://127.0.0.1:8000', - }, - // 验证码接口 -> 告警平台(测试阶段返回禁用状态) - '/admin-api/system/captcha': { - changeOrigin: true, - target: 'http://127.0.0.1:8000', - }, - // 字典数据接口 -> 告警平台(测试阶段返回空) - '/admin-api/system/dict-data': { - changeOrigin: true, - target: 'http://127.0.0.1:8000', - }, - // 消息通知接口 -> 告警平台(测试阶段返回空) - '/admin-api/system/notify-message': { - changeOrigin: true, - target: 'http://127.0.0.1:8000', - }, - // 其他接口 -> 芋道主平台(未来对接) - // 测试阶段:这些接口会 404,但不影响核心功能 + // ==================== 芋道主平台 ==================== + // 所有 system/*、infra/* 等基础接口 -> 芋道后端 48080 '/admin-api': { changeOrigin: true, rewrite: (path) => path.replace(/^\/admin-api/, ''), + // mock代理目标地址 target: 'http://localhost:48080/admin-api', ws: true, },