feat: 项目多标签方案调整

This commit is contained in:
DEV_DSW
2026-01-19 17:06:01 +08:00
parent c6e07ed414
commit 0c0f5ec430
9 changed files with 197 additions and 152 deletions

View File

@@ -1,9 +1,9 @@
import { app, BrowserWindow } from 'electron'
import { CONFIG_KEYS } from '@common/constants'
import { setupMainWindow } from './wins';
import started from 'electron-squirrel-startup'
import configManager from '@main/service/config-service'
import logManager from '@main/service/logger'
import path from "path";
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (started) {
@@ -18,32 +18,8 @@ process.on('unhandledRejection', (reason, promise) => {
logManager.error('unhandledRejection', reason, promise);
});
const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 1920,
height: 1080,
autoHideMenuBar: true,
webPreferences: {
preload: path.join(__dirname, "preload.js"),
},
});
// and load the index.html of the app.
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
} else {
mainWindow.loadFile(
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`)
);
}
// Open the DevTools.
mainWindow.webContents.openDevTools();
};
app.whenReady().then(() => {
createWindow();
setupMainWindow();
});
// Quit when all windows are closed, except on macOS. There, it's common
@@ -60,6 +36,6 @@ app.on('window-all-closed', () => {
// dock icon is clicked and there are no other windows open.
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
setupMainWindow();
}
});