Skip to content

Commit

Permalink
开发:增加日志
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Oct 30, 2024
1 parent 070c58c commit a390f01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions electron/mapi/server/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ServerApi from './api'
import {ipcMain} from "electron";
import file from "../file";
import {Log} from "../log/main";

const serverModule = {}

Expand All @@ -18,7 +18,7 @@ const getModule = async (serverInfo: ServerInfo) => {
await module.default.init(ServerApi)
serverModule[serverInfo.localPath] = module.default
} catch (e) {
console.error('getModule.error', e)
Log.error('mapi.server.getModule.error', e)
throw new Error(e)
}
}
Expand Down
11 changes: 7 additions & 4 deletions src/declarations/mapi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,20 @@ declare interface Window {
}) => Promise<void>,
},
misc: {
// define any string to any value
[key: string]: Function,
getZipFileContent: (path: string, pathInZip: string) => Promise<string>,
unzip: (zipPath: string, dest: string, option?: { process: Function }) => Promise<void>,
},

ffmpeg: {
version: () => Promise<string>,
run: (args: string[]) => Promise<string>,
},
server: {
// define any string to any value
[key: string]: Function,
start: (serverInfo: ServerInfo) => Promise<void>,
ping: (serverInfo: ServerInfo) => Promise<boolean>,
stop: (serverInfo: ServerInfo) => Promise<void>,
config: (serverInfo: ServerInfo) => Promise<any>,
callFunction: (serverInfo: ServerInfo, method: string, data: any) => Promise<any>,
},
}
}
Expand Down

0 comments on commit a390f01

Please sign in to comment.