跳转优化
This commit is contained in:
parent
74e442730a
commit
1a0a566a4f
17
src/App.vue
17
src/App.vue
|
|
@ -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: "/" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue