From 12e413771aa5223482c812181f769346ecfdc800 Mon Sep 17 00:00:00 2001 From: tcubic <123456> Date: Mon, 8 Aug 2022 18:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Home/Home.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/page/Home/Home.vue b/src/page/Home/Home.vue index ec306e1..570f2a5 100644 --- a/src/page/Home/Home.vue +++ b/src/page/Home/Home.vue @@ -187,7 +187,6 @@ onBeforeMount(() => { wxAuthGetCode(); } - // 一步授权 // if(h5plugin.getQueryString("openid")){ // console.log("存在openid"); @@ -236,14 +235,12 @@ const getCode2 = () => { }; const wxAuthGetCode = () => { - // var appId = "wx35766a64d73d08a9"; var appId = "wx41d80a1bb01f658d"; + var url = URLEncode(window.location.href); - - var url = urlEncode(window.location.href); - window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx35766a64d73d08a9&redirect_uri={{url}}&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect` +window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${url}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect` };