修复图标错误问题

This commit is contained in:
ACT丶流星雨 2026-02-10 17:59:43 +08:00
parent 324bdbd48f
commit d2ce2b2c7b
3 changed files with 26 additions and 8 deletions

View File

@ -19,7 +19,7 @@
},
"scripts": {
"dev": "nodemon --inspect --exec tsx src/app.ts",
"dev:gui": "chcp 65001 && electronmon -r tsx scripts/main.ts",
"dev:gui": "electronmon -r tsx scripts/main.ts",
"lint": "tsc --noEmit",
"build": "cross-env NODE_ENV=prod tsx scripts/build.ts",
"pack": "electron-builder --dir",

View File

@ -3,17 +3,21 @@ import path from "path";
import startServe, { closeServe } from "src/app";
function createMainWindow(): void {
const isDev = process.env.NODE_ENV === "dev" || !app.isPackaged;
const basePath = isDev ? process.cwd() : app.getAppPath();
const win = new BrowserWindow({
width: 900,
height: 600,
show: true,
autoHideMenuBar: true,
icon: path.join(
basePath,
"scripts",
process.platform === "win32" ? "logo.ico" : "logo.png"
),
});
// 开发环境和生产环境使用不同的路径
const isDev = process.env.NODE_ENV === "dev" || !app.isPackaged;
const htmlPath = isDev
? path.join(process.cwd(), "scripts", "web", "index.html")
: path.join(app.getAppPath(), "scripts", "web", "index.html");
const htmlPath = path.join(basePath, "scripts", "web", "index.html");
void win.loadFile(htmlPath);
}
app.whenReady().then(async () => {

View File

@ -1,6 +1,19 @@
// @db-hash 5c43bd41685a3d64e4043b3ceca985e8
// @db-hash 5a633f2d45df5d971905dd32c0ac9880
//该文件由脚本自动生成,请勿手动修改
export interface _t_video_old_20260131 {
'configId'?: number | null;
'filePath'?: string | null;
'firstFrame'?: string | null;
'id'?: number;
'model'?: string | null;
'prompt'?: string | null;
'resolution'?: string | null;
'scriptId'?: number | null;
'state'?: number | null;
'storyboardImgs'?: string | null;
'time'?: number | null;
}
export interface t_aiModelMap {
'configId'?: number | null;
'id'?: number;
@ -39,6 +52,7 @@ export interface t_config {
'manufacturer'?: string | null;
'model'?: string | null;
'modelType'?: string | null;
'name'?: string | null;
'type'?: string | null;
'userId'?: number | null;
}
@ -137,7 +151,6 @@ export interface t_video {
'time'?: number | null;
}
export interface t_videoConfig {
'aiConfigId'?: number | null;
'audioEnabled'?: number | null;
'createTime'?: number | null;
'duration'?: number | null;
@ -157,6 +170,7 @@ export interface t_videoConfig {
}
export interface DB {
"_t_video_old_20260131": _t_video_old_20260131;
"t_aiModelMap": t_aiModelMap;
"t_assets": t_assets;
"t_chatHistory": t_chatHistory;