diff --git a/src/main/ui/static/templates/alipay/v1/gateway_jsapi.js b/src/main/ui/static/templates/alipay/v1/gateway_jsapi.js index 9f876394f..783ab09d6 100644 --- a/src/main/ui/static/templates/alipay/v1/gateway_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/gateway_jsapi.js @@ -10,12 +10,14 @@ $(document).ready(function () { alert('debug:origin redirect:' + window.redirect); } var redirect = window.redirect; - while (redirect.indexOf('://') < 0) { - redirect = decodeURIComponent(redirect); - if (redirect == window.redirect) { - break; - } - window.redirect = redirect; + if (window.redirect !=null) { + while (redirect.indexOf('://') < 0) { + redirect = decodeURIComponent(redirect); + if (redirect == window.redirect) { + break; + } + window.redirect = redirect; + } } } @@ -55,8 +57,9 @@ $(document).ready(function () { } else { // 如果没有注入则监听注入的事件 document.addEventListener('AlipayJSBridgeReady', function () { - callPayment(pay.trade_no); - }, false); + + }); + callPayment(pay.trade_no); } },