From 3ab1dfae30cc68ad5069bdc934aa5303b252d653 Mon Sep 17 00:00:00 2001 From: zzp <34701892@qq.com> Date: Sat, 8 Nov 2025 17:53:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=B7=AF=E7=94=B1):=20=E6=B8=85=E9=99=A4UR?= =?UTF-8?q?L=E4=B8=AD=E7=9A=84token=E5=8F=82=E6=95=B0=E5=B9=B6=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=85=B6=E4=BB=96=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当URL中包含token参数时,自动清除该参数并保留其他查询参数,防止token暴露在URL中 --- src/pages/realtimeInfo/pc/rank.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pages/realtimeInfo/pc/rank.vue b/src/pages/realtimeInfo/pc/rank.vue index 6a8d139..2bf6fcd 100644 --- a/src/pages/realtimeInfo/pc/rank.vue +++ b/src/pages/realtimeInfo/pc/rank.vue @@ -149,6 +149,16 @@ onMounted(async (e) => { Session.set("token", res.data.token); Session.set("userPhone", res.data.phone); + // 解构路由参数,排除token + const { token, ...otherQuery } = route.query; + // 若存在token,替换路由清除参数 + if (token) { + router.replace({ + path: route.path, // 保持当前路径不变 + query: otherQuery, // 保留其他参数 + }); + } + setTimeout(() => { window.location.reload(); }, 500);