-
+
+
-
+
@@ -170,6 +156,16 @@ onMounted(async (e) => {
}
}
+
+ // 解构路由参数,排除token
+ const { token, ...otherQuery } = route.query;
+ // 若存在token,替换路由清除参数
+ if (token) {
+ router.replace({
+ path: route.path, // 保持当前路径不变
+ query: otherQuery, // 保留其他参数
+ });
+ }
getNewsList();
});
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 5606919..0e96638 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -57,8 +57,9 @@ service.interceptors.response.use(
financialAccount: Session.get("userPhone"),
});
Session.clear(); // 清除浏览器全部临时缓存
- window.location.href = "/"; // 去登录页
- console.log("你已被登出,请重新登录");
+ window.location.reload();
+ // window.location.href = "/"; // 去登录页
+ // console.log("你已被登出,请重新登录");
// ElMessageBox.alert('你已被登出,请重新登录', '提示', {})
// .then(() => {})
// .catch(() => {});