diff --git a/src/main/index.js b/src/main/index.js index ca7c16c..673da1f 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -31,17 +31,17 @@ function createLoginWindow() { preload: join(__dirname, '../preload/index.js'), sandbox: false, nodeIntegration: true, - contextIsolation: false, // 沙箱取消 + contextIsolation: false // 沙箱取消 } }) - loginWindow.type = 'login' // 唯一标识 + loginWindow.type = 'login' // 唯一标识 // handleUpdate(loginWindow,ipcMain) // const loginURL = is.dev ? `http://localhost:5173/#/login` : `file://${__dirname}/index.html/#/login` // loginWindow.loadURL(loginURL) if (is.dev && process.env['ELECTRON_RENDERER_URL']) { loginWindow.loadURL('http://localhost:5173/#/login') } else { - loginWindow.loadFile(join(__dirname, '../renderer/index.html'), {hash: 'login'}) + loginWindow.loadFile(join(__dirname, '../renderer/index.html'), { hash: 'login' }) updateInit(loginWindow) } @@ -70,17 +70,18 @@ function createMainWindow() { preload: join(__dirname, '../preload/index.js'), sandbox: false, // nodeIntegration: true, - nodeIntegration: true, // nodeApi调用 - contextIsolation: false, // 沙箱取消 + nodeIntegration: true, // nodeApi调用 + contextIsolation: false // 沙箱取消 // webSecurity: false // 跨域关闭 } }) - mainWindow.type = 'main' // 唯一标识 + mainWindow.type = 'main' // 唯一标识 mainWindow.on('ready-to-show', () => { mainWindow.show() }) mainWindow.on('closed', () => { - setTimeout(() => { // 延迟销毁 + setTimeout(() => { + // 延迟销毁 mainWindow = null }, 1000) // app.quit() // 主窗口关闭-结束所有进程 @@ -92,7 +93,7 @@ function createMainWindow() { mainWindow.webContents.openDevTools() if (is.dev && process.env['ELECTRON_RENDERER_URL']) { - mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'] ) + mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']) } else { mainWindow.loadFile(join(__dirname, '../renderer/index.html')) } @@ -102,7 +103,6 @@ function createMainWindow() { remote.enable(mainWindow.webContents) } - // 作业窗口相关-开发中 let linkWindow async function createLinkWin(data) { @@ -120,14 +120,17 @@ async function createLinkWin(data) { contextIsolation: true } }) - linkWindow.type = 'link' // 唯一标识 + linkWindow.type = 'link' // 唯一标识 let cookieDetails = { ...data.cookieData } - await linkWindow.webContents.session.cookies.set(cookieDetails).then(()=>{ - console.log('Cookie is successful'); - }).catch( error =>{ - console.error('Cookie is error', error); - }) - + await linkWindow.webContents.session.cookies + .set(cookieDetails) + .then(() => { + console.log('Cookie is successful') + }) + .catch((error) => { + console.error('Cookie is error', error) + }) + data.fullPath = data.fullPath.replaceAll('//', '/') linkWindow.loadURL(data.fullPath) linkWindow.once('ready-to-show', () => { @@ -169,9 +172,10 @@ app.on('ready', () => { } if (mainWindow) { mainWindow.close() // 先发出这个关闭指令 - setTimeout(() => { // + setTimeout(() => { + // mainWindow.destroy() - }, 200); + }, 200) } }) @@ -199,21 +203,19 @@ app.on('ready', () => { createLinkWin(data) }) // 新窗口创建-监听 - ipcMain.on('new-window', (e,data) => { + ipcMain.on('new-window', (e, data) => { const { id, type } = data const win = BrowserWindow.fromId(id) win.type = type // 绑定独立标识 remote.enable(win.webContents) // 开启远程服务 }) - // 打开-登录窗口 createLoginWindow() app.on('activate', function () { if (BrowserWindow.getAllWindows().length === 0) createLoginWindow() }) - }) // Quit when all windows are closed, except on macOS. There, it's common diff --git a/src/renderer/index.html b/src/renderer/index.html index 9208158..68cd483 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,7 +8,7 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - + diff --git a/src/renderer/src/components/move-file/index.vue b/src/renderer/src/components/move-file/index.vue index 79926df..c53f726 100644 --- a/src/renderer/src/components/move-file/index.vue +++ b/src/renderer/src/components/move-file/index.vue @@ -55,6 +55,8 @@ + diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 8ab6111..6da0158 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -4,9 +4,15 @@

AIX智慧课堂

@@ -14,13 +20,17 @@
- +
- +
- -
{{ userStore.user.nickName }}
+ +
{{ userStore.user.nickName }}