diff --git a/src/App.vue b/src/App.vue index 12b9c776..98fc9374 100644 --- a/src/App.vue +++ b/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: "/" }); } },