From 2f4d48a8c0bcdaff2afce10daed71c1e4252f622 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Sat, 27 Jul 2024 00:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9ABUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/tool.js | 2 +- src/renderer/src/views/classBegins/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 +