From 2ca408cabeb703e0585ca10b226d6dae7e5fd90b Mon Sep 17 00:00:00 2001 From: yutou Date: Tue, 22 Dec 2020 14:53:05 +0800 Subject: [PATCH] update --- .../com/yutou/tools/utils/QQBotManager.java | 4 +-- web/js/myjs.js | 35 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/yutou/tools/utils/QQBotManager.java b/src/main/java/com/yutou/tools/utils/QQBotManager.java index 232faa3..ddefebe 100644 --- a/src/main/java/com/yutou/tools/utils/QQBotManager.java +++ b/src/main/java/com/yutou/tools/utils/QQBotManager.java @@ -116,12 +116,12 @@ public class QQBotManager { public ListeningStatus onGroupMessage(GroupMessageEvent event) { if (event.getGroup().getId() == qqGroup) { String msg = event.getMessage().contentToString(); - msg = msg.replace("!", "!"); + msg = msg.replace("!", "!").toLowerCase(); switch (msg) { case "!开机": RedisTools.Consumer.system("openPC", null); break; - case "!更新IP": + case "!更新ip": RedisTools.Consumer.system("updateIP", null); break; case "!ip": diff --git a/web/js/myjs.js b/web/js/myjs.js index 25d3ccd..d8f8ad3 100644 --- a/web/js/myjs.js +++ b/web/js/myjs.js @@ -5,9 +5,9 @@ function Base64() { // public method for encoding this.encode = function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; + let output = ""; + let chr1, chr2, chr3, enc1, enc2, enc3, enc4; + let i = 0; input = _utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); @@ -31,10 +31,10 @@ function Base64() { // public method for decoding this.decode = function (input) { - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; + let output = ""; + let chr1, chr2, chr3; + let enc1, enc2, enc3, enc4; + let i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = _keyStr.indexOf(input.charAt(i++)); @@ -59,9 +59,9 @@ function Base64() { // private method for UTF-8 encoding _utf8_encode = function (string) { string = string.replace(/\r\n/g,"\n"); - var utftext = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); + let utftext = ""; + for (let n = 0; n < string.length; n++) { + let c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { @@ -79,9 +79,9 @@ function Base64() { // private method for UTF-8 decoding _utf8_decode = function (utftext) { - var string = ""; - var i = 0; - var c = c1 = c2 = 0; + let string = ""; + let i = 0; + let c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { @@ -100,4 +100,13 @@ function Base64() { } return string; } +} +function getParam(name){ + console.log(window.location.href) + var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); + if (results == null) { + return null; + } else { + return decodeURI(results[1]) || 0; + } } \ No newline at end of file