mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: get config return null ref
This commit is contained in:
parent
6e97044437
commit
20399dc369
@ -22,7 +22,7 @@ LiteLoaderQQNT的OneBot11协议插件
|
|||||||
- [x] http调用api
|
- [x] http调用api
|
||||||
- [x] http事件上报
|
- [x] http事件上报
|
||||||
- [x] 正向websocket
|
- [x] 正向websocket
|
||||||
- [ ] 反向websocket
|
- [x] 反向websocket
|
||||||
|
|
||||||
主要功能:
|
主要功能:
|
||||||
- [x] 发送好友消息
|
- [x] 发送好友消息
|
||||||
@ -108,7 +108,7 @@ LiteLoaderQQNT的OneBot11协议插件
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
- [x] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
- [x] 重构摆脱LLAPI,目前调用LLAPI只能在renderer进程调用,需重构成在main进程调用
|
||||||
- [x] 支持正向websocket
|
- [x] 支持正、反向websocket(感谢@disymayufei的PR)
|
||||||
- [ ] 转发消息记录
|
- [ ] 转发消息记录
|
||||||
- [ ] 好友点赞api
|
- [ ] 好友点赞api
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ export class ConfigUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.reloadConfig();
|
this.reloadConfig();
|
||||||
|
return this.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
setConfig(config: Config) {
|
setConfig(config: Config) {
|
||||||
@ -37,7 +38,8 @@ export class ConfigUtil {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!fs.existsSync(this.configPath)) {
|
if (!fs.existsSync(this.configPath)) {
|
||||||
return defaultConfig
|
this.config = defaultConfig;
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
const data = fs.readFileSync(this.configPath, "utf-8");
|
const data = fs.readFileSync(this.configPath, "utf-8");
|
||||||
let jsonData: Config = defaultConfig;
|
let jsonData: Config = defaultConfig;
|
||||||
@ -62,7 +64,7 @@ export class ConfigUtil {
|
|||||||
jsonData.token = "";
|
jsonData.token = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return jsonData;
|
this.config = jsonData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user