diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index 2933a53..7a56f5e 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -115,7 +115,7 @@ export function toolWindow({url, isFile, isConsole, option={}}) { } // 创建-新窗口 let win = new Remote.BrowserWindow(config) - if (!!isFile) win.loadFile(urlAll,{hash: url}) // 加载文件 + if (!isDev) win.loadFile(urlAll,{hash: url}) // 加载文件 else win.loadURL(urlAll) // 加载url win.once('ready-to-show', () => {resolve(win)}) // 主窗口关闭事件 diff --git a/src/renderer/src/views/classBegins/index.vue b/src/renderer/src/views/classBegins/index.vue index 59a844f..73f62c6 100644 --- a/src/renderer/src/views/classBegins/index.vue +++ b/src/renderer/src/views/classBegins/index.vue @@ -36,7 +36,7 @@ import { ref, onMounted, watch, reactive } from 'vue' import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf' pdfjsLib.GlobalWorkerOptions.workerSrc = '/lib/build/pdf.worker.mjs' import pdfCanvas from '@/components/pdf/index.vue' -const { ipcRenderer } = require('electron') +const { ipcRenderer } = window.electron || {} // 传过去的参数 const pdfObj = reactive({ numberOfPdf: 2, //显示几页 @@ -125,4 +125,4 @@ onMounted(async () => {}) } } } - \ No newline at end of file +