diff --git a/front/templates/success.html b/front/templates/success.html index 16acc2d..bff9386 100644 --- a/front/templates/success.html +++ b/front/templates/success.html @@ -107,7 +107,10 @@ //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 document.getElementsByClassName('success')[0].style.display = 'block'; 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") { document.getElementsByClassName('error')[0].style.display = 'block'; document.getElementsByClassName('success')[0].style.display = 'none'; @@ -119,6 +122,7 @@ } }); } + if (typeof WeixinJSBridge == "undefined") { if (document.addEventListener) { document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);