From 69067630be162f6981a33b082c7f1e30ac46fa63 Mon Sep 17 00:00:00 2001 From: tcubic <123456> Date: Mon, 1 Aug 2022 16:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=88=E6=9D=831?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Index.vue | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/Index.vue b/src/components/Index.vue index becc772..0161891 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -180,18 +180,18 @@ const btn = () => { // 抽奖按钮 const drawBtn = ()=>{ console.log("抽奖:"); -// console.log("授权:",getAuthorize()); -let href = window.location.href; - let h_idx = window.location.href.indexOf("#"); - let out_href = href.slice(0, h_idx); + console.log("授权:",getAuthorize(1)); +// let href = window.location.href; +// let h_idx = window.location.href.indexOf("#"); +// let out_href = href.slice(0, h_idx); - service.get(process.env.VUE_APP_ZS_DOMAIN + '/wxauth/official/account/authorize',{params:{ - redirectUrl: out_href, - scope: 1, - }}).then((res) => { +// service.get(process.env.VUE_APP_ZS_DOMAIN + '/wxauth/official/account/authorize',{params:{ +// redirectUrl: out_href, +// scope: 1, +// }}).then((res) => { - console.log("招商授权结果:",res); - }) +// console.log("招商授权结果:",res); +// }) } @@ -230,12 +230,13 @@ const hideServicePop = () => { // 招商证券授权 -const getAuthorize = ()=> { +const getAuthorize = (scopeState)=> { let href = window.location.href; let h_idx = window.location.href.indexOf("#"); let out_href = href.slice(0, h_idx); - return `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${1}"`; + // return `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${1}"`; + window.location.href = `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${(out_href)}&scope=${scopeState}` }