更新
This commit is contained in:
parent
9416e1af31
commit
2405648151
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user