From b8ced8ec593ad002e06173952acf73f405926bd9 Mon Sep 17 00:00:00 2001 From: AliooWang <64893838+AliooWang@users.noreply.github.com> Date: 星期一, 14 四月 2025 16:56:43 +0800 Subject: [PATCH] Merge pull request #60 from zhitan-cloud/jiayu1.0 --- zhitan-vue/src/permission.js | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/zhitan-vue/src/permission.js b/zhitan-vue/src/permission.js index 7fc2c80..3427d73 100644 --- a/zhitan-vue/src/permission.js +++ b/zhitan-vue/src/permission.js @@ -35,9 +35,16 @@ // 璺宠繃ParentView绫诲瀷鐨勪腑闂磋妭鐐� if (firstChild.component === 'ParentView' || - (typeof firstChild.component === 'object' && firstChild.component.name === 'ParentView')) { + (typeof firstChild.component === 'object' && + firstChild.component.name === 'ParentView')) { currentNode = firstChild; - pathSegments.push(firstChild.path); + // 濡傛灉璺緞涓嶆槸浠�/寮�澶达紝鍒欐坊鍔犲埌璺緞鐗囨涓� + if (!firstChild.path.startsWith('/')) { + pathSegments.push(firstChild.path); + } else { + // 濡傛灉鏄粷瀵硅矾寰勶紝鍒欐浛鎹箣鍓嶆墍鏈夎矾寰� + pathSegments = [firstChild.path]; + } continue; } @@ -72,7 +79,10 @@ } else if (index === 0) { return segment; } else { - return `${fullPath}/${segment}`; + // 纭繚璺緞涔嬮棿涓嶄細鍑虹幇閲嶅鐨勬枩鏉� + const base = fullPath.endsWith('/') ? fullPath.slice(0, -1) : fullPath; + const part = segment.startsWith('/') ? segment : '/' + segment; + return `${base}${part}`; } }); } -- Gitblit v1.9.3