From 7bc1c783bf4559ae121347114555964b06280bd0 Mon Sep 17 00:00:00 2001
From: birt <2499248221@qq.com>
Date: 星期一, 14 四月 2025 15:39:54 +0800
Subject: [PATCH] 123

---
 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