From b0530ed9211230227a8f94e394eda779d5ae5fc1 Mon Sep 17 00:00:00 2001
From: birt <2499248221@qq.com>
Date: 星期日, 13 四月 2025 01:51:52 +0800
Subject: [PATCH] birtzhang

---
 zhitan-vue/src/layout/components/Sidebar/SidebarItem.vue |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/zhitan-vue/src/layout/components/Sidebar/SidebarItem.vue b/zhitan-vue/src/layout/components/Sidebar/SidebarItem.vue
index 3a85e7e..73346ce 100644
--- a/zhitan-vue/src/layout/components/Sidebar/SidebarItem.vue
+++ b/zhitan-vue/src/layout/components/Sidebar/SidebarItem.vue
@@ -86,7 +86,15 @@
     return props.basePath
   }
   if (routeQuery) {
-    let query = JSON.parse(routeQuery);
+    let query = routeQuery;
+    // 濡傛灉 routeQuery 鏄瓧绗︿覆锛屽垯灏濊瘯瑙f瀽瀹�
+    if (typeof routeQuery === 'string') {
+      try {
+        query = JSON.parse(routeQuery);
+      } catch (error) {
+        console.error('Error parsing query string:', routeQuery, error);
+      }
+    }
     return { path: getNormalPath(props.basePath + '/' + routePath), query: query }
   }
   return getNormalPath(props.basePath + '/' + routePath)

--
Gitblit v1.9.3