From 9397b72a2eb30182c84f5f9f5ce32bc3f64a0a46 Mon Sep 17 00:00:00 2001 From: wolter Date: Wed, 25 Dec 2024 14:07:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1jsapi=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=88=90=E5=8A=9F=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E4=B8=BA=E7=A9=BAfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/templates/success.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);