update @兼容小程序 token校验
This commit is contained in:
parent
97a0832ad2
commit
a518798413
|
@ -11,7 +11,8 @@ export async function channelJudge (channel: number, mode: number, judgeData?: a
|
||||||
// type 1 红包 2 直充/卡密 3 立减金
|
// type 1 红包 2 直充/卡密 3 立减金
|
||||||
const { type, id, group_id, ids } = judgeData;
|
const { type, id, group_id, ids } = judgeData;
|
||||||
const idNew = group_id ? ids : [id];
|
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) { // 单品
|
if (id) { // 单品
|
||||||
url = url + `&id=${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 立减金 支付宝授权
|
if (channel === 1 && mode === 1) { // 支付宝-官方领取 区分商品类型:1 红包 支付宝小程序;3 立减金 支付宝授权
|
||||||
const ua = navigator.userAgent.toLowerCase();
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
if (type === 1) {
|
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) {
|
if (isWx|| (ua.indexOf("android") > -1 && ua.indexOf("baiduboxapp") > -1) || ua.indexOf("windows") > -1) {
|
||||||
showConfirmDialog({
|
showConfirmDialog({
|
||||||
confirmButtonText: '复制',
|
confirmButtonText: '复制',
|
||||||
|
@ -71,8 +72,9 @@ export async function channelJudge (channel: number, mode: number, judgeData?: a
|
||||||
}
|
}
|
||||||
} else if (channel === 2) { // 微信
|
} else if (channel === 2) { // 微信
|
||||||
if (!isWx) { // 非微信环境 默认 微信小程序
|
if (!isWx) { // 非微信环境 默认 微信小程序
|
||||||
// 唤起小程序
|
// 唤起微信-小程序
|
||||||
const res = await GET_WXSCHEMA({
|
const res = await GET_WXSCHEMA({
|
||||||
|
token: token,
|
||||||
id: idNew,
|
id: idNew,
|
||||||
key: localStorage.getItem('key') || '',
|
key: localStorage.getItem('key') || '',
|
||||||
type: type === 1 ? 1 : 2, // 该接口专用:1-红包 2-立减金
|
type: type === 1 ? 1 : 2, // 该接口专用:1-红包 2-立减金
|
||||||
|
|
Loading…
Reference in New Issue