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);