frpc-desktop/electron/api/common.ts
2024-08-22 14:19:19 +08:00

17 lines
379 B
TypeScript

import { app, ipcMain, shell } from "electron";
import log from "electron-log";
export const initCommonApi = () => {
// 打开链接
ipcMain.on("common.openUrl", async (event, args) => {
if (args) {
log.info(`打开链接:${args}`);
shell.openExternal(args).then(() => {});
}
});
ipcMain.on("common.relaunch", () => {
app.relaunch();
});
};