This commit is contained in:
haoouba 2021-02-03 22:10:09 +08:00
parent 9416e1af31
commit 2405648151

View File

@ -12,20 +12,20 @@
LAZY_LOAD: '<?php _getLazyload() ?>',
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;
}
}
</script>