From 9065ef44baee6f8ecf5ecc2570883211a77b5f37 Mon Sep 17 00:00:00 2001 From: Gao xiaosong <704041637@qq.com> Date: Sun, 20 Sep 2020 12:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E6=8E=88=E6=9D=83=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/wechat.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/wechat.js b/libs/wechat.js index eb2b522..2e5146b 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -124,7 +124,7 @@ export function clearAuthStatus() { export function oAuth() { console.log('处理微信授权') - console.log('处理微信授权cookie',cookie.get("spread")) + console.log('处理微信授权cookie', cookie.get("spread")) console.log(store) console.log(store.state) return new Promise((resolve, reject) => { @@ -167,20 +167,20 @@ export function auth(code) { } export function toAuth() { - // wechat().then(wx => { - location.href = getAuthUrl("wxc061dee8806ff712"); - // }); + wechat().then(wx => { + location.href = getAuthUrl(appId); + }); } function getAuthUrl(appId) { - + // const redirect_uri = encodeURIComponent(window.location.href); // const redirect_uri = encodeURIComponent(`${location.origin}/pages/Loading/index`); - - // #ifdef H5 - // #endif - - + + // #ifdef H5 + // #endif + + const redirect_uri = encodeURIComponent(`${location.origin}/pages/Loading/index?path=${encodeURIComponent(window.location.href)}`); // const redirect_uri = encodeURIComponent(`${window.location.origin}${window.location.pathname}`) // const redirect_uri = encodeURIComponent(`${location.origin}`)