跳转优化

This commit is contained in:
bb_pan 2025-02-26 17:02:18 +08:00
parent 74e442730a
commit 1a0a566a4f
1 changed files with 12 additions and 5 deletions

View File

@ -18,11 +18,18 @@ export default {
components: { ThemePicker }, components: { ThemePicker },
created() { created() {
get(); get();
const originHref = window.location.href; // const originHref = window.location.href;
console.log(originHref, "originHref----"); // console.log(originHref, "originHref----");
if (originHref.indexOf("token") !== -1) { // if (originHref.indexOf("token") !== -1) {
const token = originHref.split("token"); // const token = originHref.split("token");
setToken(token[1].slice(1)); // setToken(token[1].slice(1));
// this.$router.push({ path: "/" });
// }
const urlParams = new URLSearchParams(window.location.search);
const token = urlParams.get('token');
console.log('🚀 ~ created ~ token:', token);
if (token) {
setToken(token);
this.$router.push({ path: "/" }); this.$router.push({ path: "/" });
} }
}, },