From 2405648151610a223df78ba9d75283878115cd71 Mon Sep 17 00:00:00 2001 From: haoouba <2323333339@qq.com> Date: Wed, 3 Feb 2021 22:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/include.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/include.php b/public/include.php index 8b229a1..15c06ee 100644 --- a/public/include.php +++ b/public/include.php @@ -12,20 +12,20 @@ LAZY_LOAD: '', encryption: str => window.btoa(unescape(encodeURIComponent(str))), decrypt: str => decodeURIComponent(escape(window.atob(str))), - changeURLArg: function(url, arg, arg_val) { - let pattern = arg + '=([^&]*)' - let replaceText = arg + '=' + arg_val + changeURLArg: (url, arg, arg_val) => { + let pattern = arg + '=([^&]*)'; + let replaceText = arg + '=' + arg_val; if (url.match(pattern)) { - let tmp = '/(' + arg + '=)([^&]*)/gi' - return url.replace(eval(tmp), replaceText) + let tmp = '/(' + arg + '=)([^&]*)/gi'; + return url.replace(eval(tmp), replaceText); } else { if (url.match('[?]')) { - return url + '&' + replaceText + return url + '&' + replaceText; } else { - return url + '?' + replaceText + return url + '?' + replaceText; } } - return url + '\n' + arg + '\n' + arg_val + return url + '\n' + arg + '\n' + arg_val; } }