fix redirect on qrpay page

master
yixian 6 years ago
parent 503447d08b
commit 683a52e209

@ -17,25 +17,7 @@ $(function () {
if (window.disable_ws) { if (window.disable_ws) {
setTimeout(checkStatus, 3000); setTimeout(checkStatus, 3000);
function checkStatus() {
$.ajax({
url: 'status',
method: 'get',
cache: false,
dataType: 'json',
success: function (status) {
if (status.result_code == 'PAY_SUCCESS') {
var concat = '?';
if (window.redirect.indexOf('?') > 0) {
concat = '&';
}
location.href = window.redirect + concat + 'time=' + status.time + '&nonce_str=' + status.nonce_str + '&sign=' + status.sign;
} else {
setTimeout(checkStatus, 3000);
}
}
})
}
} else { } else {
var sock = new SockJS('/register'); var sock = new SockJS('/register');
@ -49,6 +31,27 @@ $(function () {
} }
location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign; location.href = window.redirect + concat + 'time=' + json.time + '&nonce_str=' + json.nonce_str + '&sign=' + json.sign;
}) })
},function () {
setTimeout(checkStatus, 3000);
})
}
function checkStatus() {
$.ajax({
url: 'status',
method: 'get',
cache: false,
dataType: 'json',
success: function (status) {
if (status.result_code == 'PAY_SUCCESS') {
var concat = '?';
if (window.redirect.indexOf('?') > 0) {
concat = '&';
}
location.href = window.redirect + concat + 'time=' + status.time + '&nonce_str=' + status.nonce_str + '&sign=' + status.sign;
} else {
setTimeout(checkStatus, 3000);
}
}
}) })
} }
}); });
Loading…
Cancel
Save