From 5712e77a293b94ae83c1d81385cc9fd215ccee54 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 23 Jul 2024 14:08:00 +0800 Subject: [PATCH] openwindow --- src/main/index.js | 17 +++++++---------- src/renderer/src/views/prepare/index.vue | 1 - 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index c3e9cd0..56a0833 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -84,16 +84,13 @@ function createOpenWin(data) { nodeIntegration: true } }) - - openWindow.webContents.session.cookies.set({...data.cookieData}, - (error)=> { - if (error) { - console.error('Set cookie failed:', error) - } else { - console.log('Cookie set successfully.') - } - } - ) + let cookieDetails = {...data.cookieData} + openWindow.webContents.session.cookies.set(cookieDetails).then(()=>{ + console.log('Cookie set successfully.') + }).catch(err =>{ + console.error('Set cookie failed:', error) + }) + openWindow.loadURL(data.fullPath) openWindow.once('ready-to-show', () => { diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 4644524..6ce62f1 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -276,7 +276,6 @@ export default { nodeClick(data) { if (this.currentNode.id === data.node.id) return this.curBookImg = data.textBook.curBookImg - console.log(data.textBook) this.checkFileList = [] let cata = parseCataByNode(data.node) this.currentNode = data.node