Skip to content

Let's use AI to Earn!

feat: 撤销单例锁,测试打包

yikaJasonMic896c169a8e92
diff --git a/electron/global/notice.ts b/electron/global/notice.ts
new file mode 100644
index 00000000..8c67e74f
--- /dev/null
+++ b/electron/global/notice.ts
@@ -0,0 +1,18 @@
+/*
+ * @Author: nevin
+ * @Date: 2025-03-24 23:18:06
+ * @LastEditTime: 2025-03-24 23:19:06
+ * @LastEditors: nevin
+ * @Description: 系统通知
+ */
+import { Notification } from 'electron';
+export const sysNotice = (title: string, body: string) =>
+ new Promise((resolve, reject) => {
+ if (!Notification.isSupported()) {
+ reject('当前系统不支持通知');
+ }
+ const options = typeof title === 'object' ? title : { title, body };
+ const notification = new Notification(options);
+ notification.on('click', resolve);
+ notification.show();
+ });
diff --git a/electron/main/index.ts b/electron/main/index.ts
index fbcb7b2b..27889601 100644
--- a/electron/main/index.ts
+++ b/electron/main/index.ts
@@ -31,10 +31,10 @@ if (os.release().startsWith('6.1')) app.disableHardwareAcceleration();
if (process.platform === 'win32') app.setAppUserModelId(app.getName());
// 单例锁
-if (!app.requestSingleInstanceLock()) {
- app.quit();
- process.exit(0);
-}
+// if (!app.requestSingleInstanceLock()) {
+// app.quit();
+// process.exit(0);
+// }
let win: BrowserWindow | null = null;
let splashWindow: SplashWindow | null = null;