Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix: 修复代理地址错误会报错的问题
gaoSir5cca987eef5e
diff --git a/electron/main/index.ts b/electron/main/index.tsindex 135fc35a..575d5f5e 100644--- a/electron/main/index.ts+++ b/electron/main/index.ts@@ -13,6 +13,7 @@ import { SplashWindow } from './splash';import dotenv from 'dotenv';import KwaiPubListener from './plat/platforms/Kwai/KwaiPubListener';import { registerContextMenuListener } from '@electron-uikit/contextmenu';+import { dialog } from 'electron';const platform = process.platform;dotenv.config();@@ -25,6 +26,10 @@ export const MAIN_DIST = path.join(process.env.APP_ROOT, 'dist-electron');export const RENDERER_DIST = path.join(process.env.APP_ROOT, 'dist');export const VITE_DEV_SERVER_URL = process.env.VITE_DEV_SERVER_URL;+dialog.showErrorBox = (title, content) => {+ console.error(`Error: ${title}\n${content}`);+};+process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL? path.join(process.env.APP_ROOT, 'public'): RENDERER_DIST;