From 1a0a566a4f711b499263e79a6201d5e12882eb7f Mon Sep 17 00:00:00 2001 From: bb_pan Date: Wed, 26 Feb 2025 17:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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: "/" }); } },