chore: fix

This commit is contained in:
手瓜一十雪
2024-08-11 00:53:15 +08:00
parent 2f2c1f263a
commit 191ce0798f
2 changed files with 5 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ export class NTQQFileApi {
} }
async copyFile(filePath: string, destPath: string) { async copyFile(filePath: string, destPath: string) {
await this.context.wrapper.util.copyFile(filePath, destPath); await this.core.util.copyFile(filePath, destPath);
} }
async getFileSize(filePath: string): Promise<number> { async getFileSize(filePath: string): Promise<number> {

View File

@@ -28,6 +28,7 @@ export class OB11PassiveHttpAdapter implements IOB11NetworkAdapter {
this.actionMap.set(action.actionName, action); this.actionMap.set(action.actionName, action);
} }
registerActionMap(actionMap: Map<string, BaseAction<any, any>>) { registerActionMap(actionMap: Map<string, BaseAction<any, any>>) {
this.actionMap = actionMap; this.actionMap = actionMap;
} }
registerHeartBeat() { registerHeartBeat() {
@@ -53,8 +54,8 @@ export class OB11PassiveHttpAdapter implements IOB11NetworkAdapter {
this.server = http.createServer(this.app); this.server = http.createServer(this.app);
this.app.use(express.json()); this.app.use(express.json());
this.app.use(express.urlencoded({ extended: false }));
this.app.all('/*', this.handleRequest.bind(this)); this.app.use('/', (req, res) => this.handleRequest(req, res));
this.server.listen(this.port, () => { this.server.listen(this.port, () => {
this.coreContext.context.logger.log(`HTTP server listening on port ${this.port}`); this.coreContext.context.logger.log(`HTTP server listening on port ${this.port}`);
@@ -85,5 +86,6 @@ export class OB11PassiveHttpAdapter implements IOB11NetworkAdapter {
this.isOpen = false; this.isOpen = false;
this.hasBeenClosed = true; this.hasBeenClosed = true;
this.server?.close(); this.server?.close();
this.app = undefined;
} }
} }