bace42a3 by lihua

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

1 parent a5d80329
......@@ -26,7 +26,7 @@ watch(
if (tab.fullPath.includes(jionPath)) {
pathIndex.value = index
}
return tab.fullPath === decodeURIComponent(newRouter.fullPath);
return tab.fullPath === newRouter.fullPath;
});
if (isExist.length == 0) {
if (pathIndex.value != -1 && routerLength > 3) {
......@@ -46,10 +46,10 @@ watch(
}
}
list.map(item => {
item.fullPath = decodeURIComponent(item.fullPath);
item.fullPath = item.fullPath;
})
tabbarList.value = list;
tabbarActive.value = decodeURIComponent(newRouter.fullPath);
tabbarActive.value = newRouter.fullPath;
userStore.setTabbar(tabbarList.value);
userStore.setActiveTabbar(combPath, newRouter.fullPath);
},
......
......@@ -177,7 +177,25 @@ const messageJump = (item) => {
});
drawerVisible.value = false;
} else {
router.push(item.jumpUrl);
// 假设这是你要解析和重定向的原始 URL
const originalUrl = item.jumpUrl;
// 解析 URL
const url = new URL(originalUrl, window.location.origin);
const params = new URLSearchParams(url.search);
// 提取查询参数
const queryParams = {};
for (const [key, value] of params.entries()) {
queryParams[key] = value;
}
// 使用 router.push 导航到相同的路径并传递 query 参数
router.push({
path: url.pathname,
query: queryParams
});
// router.push(encodeURIComponent(item.jumpUrl));
drawerVisible.value = false;
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!