From 88cebf064394be1a92a328fc46a024dd6c9f7ead Mon Sep 17 00:00:00 2001 From: Guwan Date: Sun, 20 Jul 2025 18:29:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E7=A9=BA?= =?UTF-8?q?=E7=9A=84electron=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 9 +++------ src/main/index.ts | 8 +++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 2cc52f6..786f575 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,14 @@ .DS_Store node_modules -/dist - +dist +out # local env files .env.local .env.*.local # Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* +*.log* # Editor directories and files .idea diff --git a/src/main/index.ts b/src/main/index.ts index 5dae989..c7ec75d 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -44,7 +44,13 @@ function createWindow(): void { // Some APIs can only be used after this event occurs. app.whenReady().then(() => { // Set app user model id for windows - electronApp.setAppUserModelId('com.electron') + // 这里一般设置为 AppUserModelID 是 Windows 系统中用于识别应用程序的唯一标识符,主要用于以下几个方面: + // 任务栏分组 - 确保相同应用程序的多个窗口在任务栏中被正确地组合在一起 + // 通知 - 将通知与特定应用程序关联 + // 跳转列表 - 为应用程序提供自定义的跳转列表 + // 'com.electron' 是一个示例值,这是 Electron 应用程序模板提供的默认值。在实际应用中,你应该将其修改为你自己应用的唯一标识符,通常使用反向域名格式,例如:'com.你的公司名称.你的应用名称'。 + // electronApp.setAppUserModelId('com.yourcompany.yourapp') + electronApp.setAppUserModelId('com.electron.tp') // Default open or close DevTools by F12 in development // and ignore CommandOrControl + R in production.