This commit is contained in:
杜恒
2021-01-27 17:10:23 +08:00
parent 775a57e7dd
commit c8c194ab55
11 changed files with 350 additions and 177 deletions

View File

@@ -10,6 +10,21 @@
BAIDU_PUSH: <?php echo $this->options->JBaiduToken ? 'true' : 'false' ?>,
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
if (url.match(pattern)) {
let tmp = '/(' + arg + '=)([^&]*)/gi'
return url.replace(eval(tmp), replaceText)
} else {
if (url.match('[?]')) {
return url + '&' + replaceText
} else {
return url + '?' + replaceText
}
}
return url + '\n' + arg + '\n' + arg_val
}
}
</script>
<style>