This commit is contained in:
yutou 2020-12-22 14:53:05 +08:00
parent e5a7f5a878
commit 2ca408cabe
2 changed files with 24 additions and 15 deletions

View File

@ -116,12 +116,12 @@ public class QQBotManager {
public ListeningStatus onGroupMessage(GroupMessageEvent event) { public ListeningStatus onGroupMessage(GroupMessageEvent event) {
if (event.getGroup().getId() == qqGroup) { if (event.getGroup().getId() == qqGroup) {
String msg = event.getMessage().contentToString(); String msg = event.getMessage().contentToString();
msg = msg.replace("", "!"); msg = msg.replace("", "!").toLowerCase();
switch (msg) { switch (msg) {
case "!开机": case "!开机":
RedisTools.Consumer.system("openPC", null); RedisTools.Consumer.system("openPC", null);
break; break;
case "!更新IP": case "!更新ip":
RedisTools.Consumer.system("updateIP", null); RedisTools.Consumer.system("updateIP", null);
break; break;
case "!ip": case "!ip":

View File

@ -5,9 +5,9 @@ function Base64() {
// public method for encoding // public method for encoding
this.encode = function (input) { this.encode = function (input) {
var output = ""; let output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4; let chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0; let i = 0;
input = _utf8_encode(input); input = _utf8_encode(input);
while (i < input.length) { while (i < input.length) {
chr1 = input.charCodeAt(i++); chr1 = input.charCodeAt(i++);
@ -31,10 +31,10 @@ function Base64() {
// public method for decoding // public method for decoding
this.decode = function (input) { this.decode = function (input) {
var output = ""; let output = "";
var chr1, chr2, chr3; let chr1, chr2, chr3;
var enc1, enc2, enc3, enc4; let enc1, enc2, enc3, enc4;
var i = 0; let i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) { while (i < input.length) {
enc1 = _keyStr.indexOf(input.charAt(i++)); enc1 = _keyStr.indexOf(input.charAt(i++));
@ -59,9 +59,9 @@ function Base64() {
// private method for UTF-8 encoding // private method for UTF-8 encoding
_utf8_encode = function (string) { _utf8_encode = function (string) {
string = string.replace(/\r\n/g,"\n"); string = string.replace(/\r\n/g,"\n");
var utftext = ""; let utftext = "";
for (var n = 0; n < string.length; n++) { for (let n = 0; n < string.length; n++) {
var c = string.charCodeAt(n); let c = string.charCodeAt(n);
if (c < 128) { if (c < 128) {
utftext += String.fromCharCode(c); utftext += String.fromCharCode(c);
} else if((c > 127) && (c < 2048)) { } else if((c > 127) && (c < 2048)) {
@ -79,9 +79,9 @@ function Base64() {
// private method for UTF-8 decoding // private method for UTF-8 decoding
_utf8_decode = function (utftext) { _utf8_decode = function (utftext) {
var string = ""; let string = "";
var i = 0; let i = 0;
var c = c1 = c2 = 0; let c = c1 = c2 = 0;
while ( i < utftext.length ) { while ( i < utftext.length ) {
c = utftext.charCodeAt(i); c = utftext.charCodeAt(i);
if (c < 128) { if (c < 128) {
@ -100,4 +100,13 @@ function Base64() {
} }
return string; 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;
}
} }