刘洋 8 tháng trước cách đây
mục cha
commit
99be23616a
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      src/main/index.ts

+ 6 - 0
src/main/index.ts

@@ -9,6 +9,12 @@ import process from "process";
 const isDev = process.env.NODE_ENV === "development";
 let win: BrowserWindow | null = null;
 let loadWin: any = null;
+const additionalData = { lockKey: "scanAdmin" };
+const gotTheLock = app.requestSingleInstanceLock(additionalData);
+console.log("gotTheLock", gotTheLock);
+if (!gotTheLock) {
+  app.quit();
+}
 
 function createWin() {
   const { width, height } = screen.getPrimaryDisplay().bounds;