This commit is contained in:
tcubic 2022-08-01 16:46:14 +08:00
parent ae1ef2c29b
commit 69067630be

View File

@ -180,18 +180,18 @@ const btn = () => {
// //
const drawBtn = ()=>{ const drawBtn = ()=>{
console.log("抽奖:"); console.log("抽奖:");
// console.log("",getAuthorize()); console.log("授权:",getAuthorize(1));
let href = window.location.href; // let href = window.location.href;
let h_idx = window.location.href.indexOf("#"); // let h_idx = window.location.href.indexOf("#");
let out_href = href.slice(0, h_idx); // let out_href = href.slice(0, h_idx);
service.get(process.env.VUE_APP_ZS_DOMAIN + '/wxauth/official/account/authorize',{params:{ // service.get(process.env.VUE_APP_ZS_DOMAIN + '/wxauth/official/account/authorize',{params:{
redirectUrl: out_href, // redirectUrl: out_href,
scope: 1, // scope: 1,
}}).then((res) => { // }}).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 href = window.location.href;
let h_idx = window.location.href.indexOf("#"); let h_idx = window.location.href.indexOf("#");
let out_href = href.slice(0, h_idx); 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}`
} }