Kill a bug

这个提交包含在:
2022-06-06 23:18:16 +08:00
父节点 f4fe5fb215
当前提交 ea13f0c619
共有 3 个文件被更改,包括 41 次插入 和 2 次删除

21
CGI.js
查看文件

@ -29,6 +29,27 @@ request.post({
console.log(Session);
exports.HOOK = HOOK;
exports.frame={
raw: function(u,MData){
var Req = new net.Socket();
var KData = MData.replace("@Session",Session);
var BData = Buffer.from(KData);
console.log(KData)
var MainData = `POST /${u} HTTP/1.1\r\nHost: 127.0.0.1:${ServicePort}\r\nContent-Type: application/json; charset=UTF-8;\r\nContent-Length:${KData.length}\r\n\r\n`;
console.log(MainData)
Req.connect(ServicePort,"127.0.0.1",()=>{
Req.write(MainData);
Req.write(BData);
Req.on("data",(data)=>{
console.log(data.toString());
});
Req.on("end",()=>{
Req.end();
});
Req.on("close",()=>{
Req.end();
})
});
},
SendImg: function(c,info,p){
this.SetHook(true);

查看文件

@ -48,7 +48,7 @@ global.LoadMoudel = (() => {
});
}))
}
})
})
})
global.LoadMoudel();
//var HOOK = false;
@ -291,5 +291,6 @@ exports.frame={
console.log("["+new Date().toString()+"][./Core.js]线程处理完毕\r\n");
}
}
global.DEBUG.CGI = JSCGI;
global.DEBUG.Debug = require("./Debug.js");

19
WRH.ts
查看文件

@ -1,2 +1,19 @@
// Word Recitation Helper
// 单词背诵助手
// 单词背诵助手
import * as Core from "./Core";
const command = {
"prefix":"WRH",
"answer":"ANS ",
"key":"KEY",
"require":"REQ",
"select":"SEL ",
"rankinglist":"RAL"
}
Core.AddListener((c,i)=>{
if(i.message.substring(0,command.prefix.length) == command.prefix){
var subcommand = i.message.replace(command.prefix,"");
subcommand
}
})