diff --git a/src/utils/empower.ts b/src/utils/empower.ts index f1e9816..7d08bee 100644 --- a/src/utils/empower.ts +++ b/src/utils/empower.ts @@ -11,7 +11,8 @@ export async function channelJudge (channel: number, mode: number, judgeData?: a // type 1 红包 2 直充/卡密 3 立减金 const { type, id, group_id, ids } = judgeData; const idNew = group_id ? ids : [id]; - let url = `${location.origin}${location.pathname}?key=${localStorage.getItem('key') || ''}&token=${localStorage.getItem('token')}`; + const token = localStorage.getItem('token') || ''; + let url = `${location.origin}${location.pathname}?key=${localStorage.getItem('key') || ''}&token=${token}`; if (id) { // 单品 url = url + `&id=${id}`; } @@ -37,7 +38,7 @@ export async function channelJudge (channel: number, mode: number, judgeData?: a if (channel === 1 && mode === 1) { // 支付宝-官方领取 区分商品类型:1 红包 支付宝小程序;3 立减金 支付宝授权 const ua = navigator.userAgent.toLowerCase(); if (type === 1) { - const aliPaysUrl = `${zfbAuthMiniUrl}&page=pages/exchange/exchange?${encodeURIComponent(`key=${window.btoa(localStorage.getItem('key') || '')}&ids=${window.btoa(JSON.stringify(idNew))}`)}`; + const aliPaysUrl = `${zfbAuthMiniUrl}&page=pages/exchange/exchange?${encodeURIComponent(`key=${window.btoa(localStorage.getItem('key') || '')}&ids=${window.btoa(JSON.stringify(idNew))}&token=${window.btoa(token)}`)}`; if (isWx|| (ua.indexOf("android") > -1 && ua.indexOf("baiduboxapp") > -1) || ua.indexOf("windows") > -1) { showConfirmDialog({ confirmButtonText: '复制', @@ -71,8 +72,9 @@ export async function channelJudge (channel: number, mode: number, judgeData?: a } } else if (channel === 2) { // 微信 if (!isWx) { // 非微信环境 默认 微信小程序 - // 唤起小程序 + // 唤起微信-小程序 const res = await GET_WXSCHEMA({ + token: token, id: idNew, key: localStorage.getItem('key') || '', type: type === 1 ? 1 : 2, // 该接口专用:1-红包 2-立减金