主进程
// 保证窗口只有一个主程序
const gotTheLock = app.requestSingleInstanceLock();
if (gotTheLock) {
app.on('second-instance', (event, commandLine, workingDirectory) => {
console.log(event, workingDirectory);
if (win) {
if (win.isMinimized()) win.restore();
win.focus();
}
});
} else {
app.quit();
}