Jelajahi Sumber

fix: 打包执行错误问题

zhangjie 1 tahun lalu
induk
melakukan
ee7e867a44

+ 3 - 3
electron/main/useWinProcess.ts

@@ -28,8 +28,6 @@ async function buildChildWindow(
   loadPageUrl: string
 ) {
   const childWin = new BrowserWindow({
-    // width: 1428,
-    // height: 700,
     width: 400,
     height: 400,
     show: false,
@@ -48,7 +46,9 @@ async function buildChildWindow(
     // childWin.webContents.openDevTools();
   } else {
     // Load the index.html when not in development
-    await childWin.loadURL(`app://./index.html${pageUrl}`);
+    await childWin.loadFile(join(__dirname, '../renderer/index.html'), {
+      hash: pageUrl,
+    });
   }
   return childWin;
 }

+ 1 - 1
index.html

@@ -7,7 +7,7 @@
   <meta http-equiv="Content-Security-Policy"
     content="script-src 'self'; style-src 'self' 'unsafe-inline';" />
   <title>
-    mark-tool
+    知学知考-图片导出工具
   </title>
 </head>
 

+ 5 - 1
src/views/base/track-export/trackTaskExport.vue

@@ -7,7 +7,7 @@
   import { useRoute } from 'vue-router';
 
   import { UserState } from '@/store/modules/user/types';
-  import { useUserStore } from '@/store';
+  import { useUserStore, useAppStore } from '@/store';
   import useTimeout from '@/hooks/timout';
   import useDraw from './useDraw';
 
@@ -24,6 +24,7 @@
   ) as UserState;
   const userStore = useUserStore();
   userStore.setInfo(userInfo);
+  const appStore = useAppStore();
 
   const { runTask, getTrackTask, getTrackTaskDetail, addLog } = useDraw(winId);
   const { addSetTimeout, clearSetTimeout } = useTimeout();
@@ -71,6 +72,9 @@
   }
 
   async function startTask() {
+    const domain = await window.db.getDict('domain');
+    appStore.setInfo({ domain });
+
     addLog(`00-开启进程`);
     registEvent();
     let result = true;