bace42a3 by lihua

解决消息路由编码导致缓存失效问题

1 parent a5d80329
...@@ -26,7 +26,7 @@ watch( ...@@ -26,7 +26,7 @@ watch(
26 if (tab.fullPath.includes(jionPath)) { 26 if (tab.fullPath.includes(jionPath)) {
27 pathIndex.value = index 27 pathIndex.value = index
28 } 28 }
29 return tab.fullPath === decodeURIComponent(newRouter.fullPath); 29 return tab.fullPath === newRouter.fullPath;
30 }); 30 });
31 if (isExist.length == 0) { 31 if (isExist.length == 0) {
32 if (pathIndex.value != -1 && routerLength > 3) { 32 if (pathIndex.value != -1 && routerLength > 3) {
...@@ -46,10 +46,10 @@ watch( ...@@ -46,10 +46,10 @@ watch(
46 } 46 }
47 } 47 }
48 list.map(item => { 48 list.map(item => {
49 item.fullPath = decodeURIComponent(item.fullPath); 49 item.fullPath = item.fullPath;
50 }) 50 })
51 tabbarList.value = list; 51 tabbarList.value = list;
52 tabbarActive.value = decodeURIComponent(newRouter.fullPath); 52 tabbarActive.value = newRouter.fullPath;
53 userStore.setTabbar(tabbarList.value); 53 userStore.setTabbar(tabbarList.value);
54 userStore.setActiveTabbar(combPath, newRouter.fullPath); 54 userStore.setActiveTabbar(combPath, newRouter.fullPath);
55 }, 55 },
......
...@@ -177,7 +177,25 @@ const messageJump = (item) => { ...@@ -177,7 +177,25 @@ const messageJump = (item) => {
177 }); 177 });
178 drawerVisible.value = false; 178 drawerVisible.value = false;
179 } else { 179 } else {
180 router.push(item.jumpUrl); 180 // 假设这是你要解析和重定向的原始 URL
181 const originalUrl = item.jumpUrl;
182
183 // 解析 URL
184 const url = new URL(originalUrl, window.location.origin);
185 const params = new URLSearchParams(url.search);
186
187 // 提取查询参数
188 const queryParams = {};
189 for (const [key, value] of params.entries()) {
190 queryParams[key] = value;
191 }
192
193 // 使用 router.push 导航到相同的路径并传递 query 参数
194 router.push({
195 path: url.pathname,
196 query: queryParams
197 });
198 // router.push(encodeURIComponent(item.jumpUrl));
181 drawerVisible.value = false; 199 drawerVisible.value = false;
182 } 200 }
183 } 201 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!