From 67d42a22917787893c26301370521b789f108510 Mon Sep 17 00:00:00 2001 From: alger Date: Thu, 4 Jan 2024 09:39:37 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E9=99=90=E5=88=B6=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E5=90=AF=E5=8A=A8=E4=B8=80=E4=B8=AA=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 6 ++++++ components.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/app.js b/app.js index f8cbe89..9d2d93a 100644 --- a/app.js +++ b/app.js @@ -61,6 +61,12 @@ function createWindow() { } } +// 限制只能启动一个应用 +const gotTheLock = app.requestSingleInstanceLock() +if (!gotTheLock) { + app.quit() +} + app.whenReady().then(createWindow) app.on('ready',()=>{ diff --git a/components.d.ts b/components.d.ts index 48d0a2b..b6817ad 100644 --- a/components.d.ts +++ b/components.d.ts @@ -23,6 +23,7 @@ declare module 'vue' { NPopover: typeof import('naive-ui')['NPopover'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSlider: typeof import('naive-ui')['NSlider'] + NSwitch: typeof import('naive-ui')['NSwitch'] NTooltip: typeof import('naive-ui')['NTooltip'] PlayBottom: typeof import('./src/components/common/PlayBottom.vue')['default'] PlayListsItem: typeof import('./src/components/common/PlayListsItem.vue')['default']