diff --git a/src/components/Index.vue b/src/components/Index.vue index 4b184d4..988f686 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -180,7 +180,18 @@ const btn = () => { // 抽奖按钮 const drawBtn = ()=>{ console.log("抽奖:"); - console.log("授权:",getAuthorize()); +// console.log("授权:",getAuthorize()); +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) => { + + console.log("招商授权结果:",res); + }) } @@ -220,18 +231,11 @@ const hideServicePop = () => { // 招商证券授权 const getAuthorize = ()=> { - // let href = window.location.href - // let h_idx = window.location.href.indexOf('#') - // let out_href = href.slice(0,h_idx) - - // window.location.href = `${process.env.VUE_APP_ZS_DOMAIN}/wxauth/official/account/authorize?redirectUrl=${out_href}&scope=${1}"` - 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"`; + 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}"`; }