From 70660672e3890377ac94601907efefbb607fcecc Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 13 Mar 2024 15:24:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E9=9D=99=E9=BB=98=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 933cdd8..dc5ded6 100644 --- a/index.html +++ b/index.html @@ -110,8 +110,14 @@ }, async created() { - sessionStorage.clear(); - localStorage.clear(); + // 白名单不清除 + let bmd_token = this.getQueryString('token'); + if (!bmd_token) { + sessionStorage.clear(); + localStorage.clear(); + } + + await req.axiosGet('/conf/apiStatus').then(res => { if (res.data.update) { sessionStorage.setItem('notice', res.data.msg); @@ -249,13 +255,19 @@ }, // 静默授权 - wxgzAuth(is_have_webview_voucher) { + wxgzAuth(is_have_webview_voucher, token) { /* 公众号打开 */ if (is_have_webview_voucher && !this.openid) { const key = localStorage.getItem('key'); const linkId = localStorage.getItem('linkId'); - location.href = `https://openapi.1688sup.com/wechat/oauth?jump=${location.origin}/${linkId}/${key}`; - return + if (token) { + location.href = `https://openapi.1688sup.com/wechat/oauth?jump=${location.origin}/${token}`; + return + } else { + location.href = `https://openapi.1688sup.com/wechat/oauth?jump=${location.origin}/${linkId}/${key}`; + return + } + } }, @@ -342,6 +354,7 @@ } }).catch(err => { }); } else if ([1, 8].includes(this.pageType)) {//白名单 + let par = { "code": this.code, "mobile": this.key, @@ -369,7 +382,7 @@ }; let wait = await req.axiosPost('/key/loginFromMobileKey', data).then(res => { if (res.code == 200) { - this.wxgzAuth(res.data.is_have_webview_voucher); + this.wxgzAuth(res.data.is_have_webview_voucher, item); form_data_res = res; getTokenList.push(res.data.token); istoGoods = true;