diff --git a/package.json b/package.json index e33aa42..8fd8fad 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/main.ts b/scripts/main.ts index ff09072..a1e2470 100644 --- a/scripts/main.ts +++ b/scripts/main.ts @@ -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 () => { diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 100bb39..c90deda 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -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;