chore: clean code for system.ts

This commit is contained in:
Wesley F. Young 2024-08-31 14:09:25 +08:00
parent f34740f1f0
commit 3e53cbcf8f
2 changed files with 4 additions and 8 deletions

View File

@ -13,7 +13,7 @@ export class NTQQSystemApi {
return this.core.util.hasOtherRunningQQProcess(); return this.core.util.hasOtherRunningQQProcess();
} }
async ORCImage(filePath: string) { async ocrImage(filePath: string) {
return this.context.session.getNodeMiscService().wantWinScreenOCR(filePath); return this.context.session.getNodeMiscService().wantWinScreenOCR(filePath);
} }
@ -21,20 +21,16 @@ export class NTQQSystemApi {
return this.context.session.getRichMediaService().translateEnWordToZn(words); return this.context.session.getRichMediaService().translateEnWordToZn(words);
} }
//调用会超时 没灯用 (好像是通知listener的) onLineDev
async getOnlineDev() { async getOnlineDev() {
return this.context.session.getMsgService().getOnLineDev(); return this.context.session.getMsgService().getOnLineDev();
} }
//1-2-162b9b42-65b9-4405-a8ed-2e256ec8aa50
async getArkJsonCollection(cid: string) { async getArkJsonCollection(cid: string) {
return await this.core.eventWrapper.callNoListenerEvent('NodeIKernelCollectionService/collectionArkShare', '1717662698058'); return await this.core.eventWrapper.callNoListenerEvent('NodeIKernelCollectionService/collectionArkShare', '1717662698058');
} }
async BootMiniApp(appfile: string, params: string) { async bootMiniApp(appFile: string, params: string) {
await this.context.session.getNodeMiscService().setMiniAppVersion('2.16.4'); await this.context.session.getNodeMiscService().setMiniAppVersion('2.16.4');
// const c = await this.context.session.getNodeMiscService().getMiniAppPath(); return this.context.session.getNodeMiscService().startNewMiniApp(appFile, params);
return this.context.session.getNodeMiscService().startNewMiniApp(appfile, params);
} }
} }

View File

@ -26,7 +26,7 @@ export class OCRImage extends BaseAction<Payload, any> {
} }
if (path) { if (path) {
await checkFileReceived(path, 5000); // 文件不存在QQ会崩溃需要提前判断 await checkFileReceived(path, 5000); // 文件不存在QQ会崩溃需要提前判断
const ret = await NTQQSystemApi.ORCImage(path); const ret = await NTQQSystemApi.ocrImage(path);
if (!isLocal) { if (!isLocal) {
fs.unlink(path, () => { fs.unlink(path, () => {
}); });