跳转优化
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 },
|
||||
created() {
|
||||
get();
|
||||
const originHref = window.location.href;
|
||||
console.log(originHref, "originHref----");
|
||||
if (originHref.indexOf("token") !== -1) {
|
||||
const token = originHref.split("token");
|
||||
setToken(token[1].slice(1));
|
||||
// const originHref = window.location.href;
|
||||
// console.log(originHref, "originHref----");
|
||||
// if (originHref.indexOf("token") !== -1) {
|
||||
// const token = originHref.split("token");
|
||||
// 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: "/" });
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue