From 5e54b2866eb181e84de9910de06fd013a280a5c9 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 05 三月 2025 16:18:36 +0800 Subject: [PATCH] 保存实体更新 --- src/router/helper/menuHelper.ts | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/router/helper/menuHelper.ts b/src/router/helper/menuHelper.ts index f0767b2..c4eb1dc 100644 --- a/src/router/helper/menuHelper.ts +++ b/src/router/helper/menuHelper.ts @@ -1,8 +1,8 @@ -import { AppRouteModule } from '/@/router/types'; -import type { MenuModule, Menu, AppRouteRecordRaw } from '/@/router/types'; -import { findPath, treeMap } from '/@/utils/helper/treeHelper'; +import { AppRouteModule } from '@/router/types'; +import type { MenuModule, Menu, AppRouteRecordRaw } from '@/router/types'; +import { findPath, treeMap } from '@/utils/helper/treeHelper'; import { cloneDeep } from 'lodash-es'; -import { isUrl } from '/@/utils/is'; +import { isHttpUrl } from '@/utils/is'; import { RouteParams } from 'vue-router'; import { toRaw } from 'vue'; @@ -20,7 +20,7 @@ // 璇锋敞鎰忥紝浠� / 寮�澶寸殑宓屽璺緞灏嗚瑙嗕负鏍硅矾寰勩�� // This allows you to leverage the component nesting without having to use a nested URL. // 杩欏厑璁镐綘鍒╃敤缁勪欢宓屽锛岃�屾棤闇�浣跨敤宓屽 URL銆� - if (!(menu.path.startsWith('/') || isUrl(menu.path))) { + if (!(menu.path.startsWith('/') || isHttpUrl(menu.path))) { // path doesn't start with /, nor is it a url, join parent path // 璺緞涓嶄互 / 寮�澶达紝涔熶笉鏄� url锛屽姞鍏ョ埗璺緞 menu.path = `${parentPath}/${menu.path}`; @@ -33,9 +33,7 @@ // Parsing the menu module export function transformMenuModule(menuModule: MenuModule): Menu { - const { menu } = menuModule; - - const menuList = [menu]; + const menuList = [menuModule]; joinParentPath(menuList); return menuList[0]; @@ -63,12 +61,12 @@ // 鎻愬彇鏍戞寚瀹氱粨鏋� const list = treeMap(routeList, { conversion: (node: AppRouteRecordRaw) => { - const { meta: { title, hideMenu = false } = {} } = node; + const { meta: { hideMenu = false } = {}, name } = node; return { ...(node.meta || {}), meta: node.meta, - name: title, + name, hideMenu, path: node.path, ...(node.redirect ? { redirect: node.redirect } : {}), -- Gitblit v1.9.3