From 351fa05ad7716d4ebaee8d9b51ec3ebde9785064 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 30 Mar 2020 18:35:33 +0800 Subject: [PATCH] fix h5 redirect url encode --- src/main/ui/static/templates/skip_wxbrowser.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/ui/static/templates/skip_wxbrowser.js b/src/main/ui/static/templates/skip_wxbrowser.js index fbf786dcd..bdd95f702 100644 --- a/src/main/ui/static/templates/skip_wxbrowser.js +++ b/src/main/ui/static/templates/skip_wxbrowser.js @@ -8,6 +8,8 @@ $(function () { } else { location.href = window.target_href; } + decode(); + $('.close-weixin-tip').bind('touchstart', function () { $(".weixin-tip").hide(); checkOrderStd(window.client_moniker, window.partner_order_id, true); @@ -19,6 +21,17 @@ $(function () { location.href = window.target_href; }); + function decode() { + var redirect = window.redirect; + while (redirect.indexOf('://') < 0) { + redirect = decodeURIComponent(redirect); + if (redirect == window.redirect) { + break; + } + window.redirect = redirect; + } + } + function checkOrderStd(clientMoniker, merchantOrderId, needLoop) { if (!clientMoniker || !merchantOrderId) { return;