diff --git a/README.md b/README.md index 2c6c8fe..050e511 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ LiteLoaderQQNT的OneBot11协议插件 - [x] http调用api - [x] http事件上报 - [x] 正向websocket -- [ ] 反向websocket +- [x] 反向websocket 主要功能: - [x] 发送好友消息 @@ -108,7 +108,7 @@ LiteLoaderQQNT的OneBot11协议插件 ## TODO - [x] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用 -- [x] 支持正向websocket +- [x] 支持正、反向websocket(感谢@disymayufei的PR) - [ ] 转发消息记录 - [ ] 好友点赞api diff --git a/src/common/config.ts b/src/common/config.ts index d595780..9ad0d98 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -16,6 +16,7 @@ export class ConfigUtil { } this.reloadConfig(); + return this.config; } setConfig(config: Config) { @@ -37,7 +38,8 @@ export class ConfigUtil { }; if (!fs.existsSync(this.configPath)) { - return defaultConfig + this.config = defaultConfig; + return; } else { const data = fs.readFileSync(this.configPath, "utf-8"); let jsonData: Config = defaultConfig; @@ -62,7 +64,7 @@ export class ConfigUtil { jsonData.token = ""; } - return jsonData; + this.config = jsonData; } } }