feat: 微信jsapi支付成功修复跳转链接为空fix
This commit is contained in:
parent
74c1039d1c
commit
9397b72a2e
|
@ -107,7 +107,10 @@
|
||||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||||
document.getElementsByClassName('success')[0].style.display = 'block';
|
document.getElementsByClassName('success')[0].style.display = 'block';
|
||||||
document.getElementsByClassName('error')[0].style.display = 'none';
|
document.getElementsByClassName('error')[0].style.display = 'none';
|
||||||
window.location.href = {{.returnUrl}}; // 跳转
|
const returnUrl = "{{.returnUrl}}";
|
||||||
|
if (returnUrl && returnUrl.length > 0 && returnUrl.includes('http')) {
|
||||||
|
window.location.href = returnUrl; // 跳转
|
||||||
|
}
|
||||||
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
||||||
document.getElementsByClassName('error')[0].style.display = 'block';
|
document.getElementsByClassName('error')[0].style.display = 'block';
|
||||||
document.getElementsByClassName('success')[0].style.display = 'none';
|
document.getElementsByClassName('success')[0].style.display = 'none';
|
||||||
|
@ -119,6 +122,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof WeixinJSBridge == "undefined") {
|
if (typeof WeixinJSBridge == "undefined") {
|
||||||
if (document.addEventListener) {
|
if (document.addEventListener) {
|
||||||
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
||||||
|
|
Loading…
Reference in New Issue