diff --git a/src/main/index.js b/src/main/index.js index 673da1f..6064613 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -103,11 +103,12 @@ function createMainWindow() { remote.enable(mainWindow.webContents) } -// 作业窗口相关-开发中 -let linkWindow +// 打开外部链接窗口 +let linkWin = {} async function createLinkWin(data) { - if (linkWindow) return - linkWindow = new BrowserWindow({ + if (linkWin[data.key]) return + + linkWin[data.key] = new BrowserWindow({ show: false, frame: true, maximizable: true, @@ -120,9 +121,10 @@ async function createLinkWin(data) { contextIsolation: true } }) - linkWindow.type = 'link' // 唯一标识 + linkWin[data.key].type = 'link' // 唯一标识 + let cookieDetails = { ...data.cookieData } - await linkWindow.webContents.session.cookies + await linkWin[data.key].webContents.session.cookies .set(cookieDetails) .then(() => { console.log('Cookie is successful') @@ -131,14 +133,15 @@ async function createLinkWin(data) { console.error('Cookie is error', error) }) data.fullPath = data.fullPath.replaceAll('//', '/') - linkWindow.loadURL(data.fullPath) + linkWin[data.key].loadURL(data.fullPath) - linkWindow.once('ready-to-show', () => { - linkWindow.show() - linkWindow.maximize() + linkWin[data.key].once('ready-to-show', () => { + linkWin[data.key].show() + linkWin[data.key].maximize() }) - linkWindow.on('closed', () => { - linkWindow = null + linkWin[data.key].on('closed', () => { + linkWin[data.key] = null + delete linkWin[data.key] }) } diff --git a/src/renderer/src/api/teaching/classwork.js b/src/renderer/src/api/teaching/classwork.js index 9412901..57da30d 100644 --- a/src/renderer/src/api/teaching/classwork.js +++ b/src/renderer/src/api/teaching/classwork.js @@ -18,6 +18,15 @@ export function listEntpcourse(query) { }) } +// 新增entpcourse +export function addEntpcourse(data) { + return request({ + url: '/education/entpcourse', + method: 'post', + data: data + }) +} + // 布置作业 export function saveByClassWorkArray(data) { return request({ diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index d208553..2a45170 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -7,7 +7,7 @@