From 5dfc5ed44d67c631249e2018c20bea1338938a99 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 13 Mar 2024 18:21:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8home=E6=8E=88=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homepage.html | 10 ++++++++++ index.html | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/homepage.html b/homepage.html index f3a1371..a4d0828 100644 --- a/homepage.html +++ b/homepage.html @@ -235,6 +235,10 @@ tabStaticComponent }, created() { + let openid = this.getQueryString("openid"); + if (openid) { + localStorage.setItem('openid', openid); + } this.getGoods(); let productConfig = JSON.parse(localStorage.getItem('product_list')); this.bgcolor = productConfig.button_color; @@ -247,6 +251,12 @@ this.bannerUrl = productConfig.bannerUrl; }, methods: { + getQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + var r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); + return null; + }, closeTip() { this.suspension = false; }, diff --git a/index.html b/index.html index 2b04e63..ed15d50 100644 --- a/index.html +++ b/index.html @@ -402,13 +402,9 @@ this.openDialog('正在加载商品...'); localStorage.setItem('entryLink', window.location.href);//存储起始页链接 sessionStorage.setItem("bm_auth", JSON.stringify(form_data_res.data.settlement_data)); - debugger - console.log("1") // 判断是否需要静默授权 if (form_data_res.data.is_have_webview_voucher) { - location.href = `https://openapi.1688sup.com/wechat/oauth?jump=${location.origin}/homepage.html` - } // this.wxgzAuth(res.data.is_have_webview_voucher, res.data.token);