From bdb2a2dac7764f7c6e7cf76d8bdaccbfdbca1e45 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 18 Dec 2023 12:44:28 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=A7=BB=E5=8A=A8=E7=AB=AFtoken?= =?UTF-8?q?=E8=BF=87=E6=9C=9F=E4=B9=8B=E5=90=8E=E5=BE=AA=E7=8E=AF=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/mobile/src/pages/login/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/mobile/src/pages/login/index.vue b/core/mobile/src/pages/login/index.vue index 73507967d1..f4aed1d13f 100644 --- a/core/mobile/src/pages/login/index.vue +++ b/core/mobile/src/pages/login/index.vue @@ -159,12 +159,17 @@ const param = getUrlParams(url) if (param?.detoken) { if(param.detoken.endsWith('#/')) - param.detoken = param.detoken.substr(0, param.detoken.length - 2) + param.detoken = param.detoken.substr(0, param.detoken.length - 2) + + const redirect = window.location.href.split('?')[0] setToken(param.detoken) getInfo().then(res => { setUserInfo(res.data) - const redirect = window.location.href.split('?')[0] - + window.location.href = redirect + }).catch(() => { + setToken(null) + localStorage.removeItem('Authorization') + window.cookieStore.delete('Authorization') window.location.href = redirect }) return true