fix: 优化新网授权逻辑

This commit is contained in:
zhangds 2024-04-25 13:53:12 +08:00
parent a81742fd7d
commit 6b5ba08aba
2 changed files with 12 additions and 16 deletions

View File

@ -220,24 +220,27 @@
methods: { methods: {
// 统一跳转逻辑判断 // 统一跳转逻辑判断
gotoPage(data, type) { gotoPage(data, type) {
console.log("data =>", data); // 微信授权回调地址
// debugger let wxauth_url = "https://openapi.1688sup.com/wechat/oauth";
// xw 模块 // xw 模块
if (data.is_voucher_auto) { if (data.is_voucher_auto) {
const goto_url = "/xw-pages/homepage.html"; // 微信公众号授权
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
wxauth_url = `${wxauth_url}?jump=${location.origin}/xw-pages/homepage.html`;
} else {
wxauth_url = "/xw-pages/homepage.html"
}
setTimeout(() => { setTimeout(() => {
if (type) { if (type) {
window.location.replace(goto_url); window.location.replace(wxauth_url);
} else { } else {
window.location.href = goto_url; window.location.href = wxauth_url;
} }
}, 300); }, 300);
return return
} }
// 微信授权回调地址
let wxauth_url = "https://openapi.1688sup.com/wechat/oauth";
// 第一步:判断是否是 微信静默授权 是 -> 拼接回调地址 // 第一步:判断是否是 微信静默授权 是 -> 拼接回调地址
if (data.is_have_webview_voucher) { if (data.is_have_webview_voucher) {
// 第二步:判断是否是包码 是 -> 走包码回调地址 // 第二步:判断是否是包码 是 -> 走包码回调地址

View File

@ -605,15 +605,8 @@
* recharge_type 2 组合立减金 1立减金 * recharge_type 2 组合立减金 1立减金
*/ */
if (type == 2) { if (type == 2) {
// 微信公众号授权
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
let wxauth_url = "https://openapi.1688sup.com/wechat/oauth";
wxauth_url = `${wxauth_url}?jump=${location.origin}/xw-pages/reduce.html`;
window.location.replace(wxauth_url);
} else {
window.location.replace("./reduce.html"); window.location.replace("./reduce.html");
} }
}
}, },
/* banner外链跳转 */ /* banner外链跳转 */