You've already forked Nano-Banana-AI-Image-Editor
新增设置面板
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
import { app, BrowserWindow, ipcMain } from 'electron';
|
||||
import * as path from 'path';
|
||||
|
||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||
if (require('electron-squirrel-startup')) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
|
||||
const createWindow = () => {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 800,
|
||||
width: 1600,
|
||||
height: 900,
|
||||
frame: false, // 隐藏默认的窗口框架
|
||||
icon: path.join(__dirname, '../../build/icon.ico'), // 设置应用图标
|
||||
webPreferences: {
|
||||
@@ -25,16 +20,15 @@ const createWindow = () => {
|
||||
// and load the index.html of the app.
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
mainWindow.loadURL(process.env.VITE_DEV_SERVER_URL);
|
||||
// 仅在开发环境中打开开发者工具
|
||||
mainWindow.webContents.openDevTools();
|
||||
} else {
|
||||
// 使用绝对路径从项目根目录的 dist 文件夹加载
|
||||
const indexPath = path.join(__dirname, '../../dist/index.html');
|
||||
console.log('Loading index.html from:', indexPath);
|
||||
mainWindow.loadFile(indexPath);
|
||||
}
|
||||
|
||||
// Open the DevTools.
|
||||
if (process.env.VITE_DEV_SERVER_URL) {
|
||||
mainWindow.webContents.openDevTools();
|
||||
// 在生产环境中确保关闭开发者工具
|
||||
mainWindow.webContents.closeDevTools();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user