mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
perf: 升级客户端框架
This commit is contained in:
parent
aba74681ef
commit
4ed09dddcf
6
electron/electron.js
vendored
6
electron/electron.js
vendored
@ -79,7 +79,7 @@ function createMainWindow() {
|
|||||||
|
|
||||||
mainWindow.on('close', event => {
|
mainWindow.on('close', event => {
|
||||||
if (!willQuitApp) {
|
if (!willQuitApp) {
|
||||||
utils.onBeforeUnload(event).then(() => {
|
utils.onBeforeUnload(event, mainWindow).then(() => {
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
} else if (process.platform === 'darwin') {
|
} else if (process.platform === 'darwin') {
|
||||||
@ -139,8 +139,8 @@ function createSubWindow(args) {
|
|||||||
|
|
||||||
browser.on('close', event => {
|
browser.on('close', event => {
|
||||||
if (!willQuitApp) {
|
if (!willQuitApp) {
|
||||||
utils.onBeforeUnload(event).then(() => {
|
utils.onBeforeUnload(event, browser).then(() => {
|
||||||
event.sender.destroy()
|
browser.destroy()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -26,14 +26,14 @@
|
|||||||
"url": "https://github.com/kuaifan/dootask.git"
|
"url": "https://github.com/kuaifan/dootask.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron-forge/cli": "^6.1.1",
|
"@electron-forge/cli": "^6.3.0",
|
||||||
"@electron-forge/maker-deb": "^6.1.1",
|
"@electron-forge/maker-deb": "^6.3.0",
|
||||||
"@electron-forge/maker-rpm": "^6.1.1",
|
"@electron-forge/maker-rpm": "^6.3.0",
|
||||||
"@electron-forge/maker-squirrel": "^6.1.1",
|
"@electron-forge/maker-squirrel": "^6.3.0",
|
||||||
"@electron-forge/maker-zip": "^6.1.1",
|
"@electron-forge/maker-zip": "^6.3.0",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"electron": "^24.5.0",
|
"electron": "^25.5.0",
|
||||||
"electron-builder": "^23.6.0",
|
"electron-builder": "^24.6.3",
|
||||||
"electron-notarize": "^1.2.2",
|
"electron-notarize": "^1.2.2",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"ora": "^4.1.1"
|
"ora": "^4.1.1"
|
||||||
@ -44,7 +44,7 @@
|
|||||||
"electron-log": "^4.4.8",
|
"electron-log": "^4.4.8",
|
||||||
"electron-screenshots-tool": "^1.0.4",
|
"electron-screenshots-tool": "^1.0.4",
|
||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-squirrel-startup": "^1.0.0",
|
||||||
"electron-updater": "^5.3.0",
|
"electron-updater": "^6.1.1",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
"request": "^2.88.2"
|
"request": "^2.88.2"
|
||||||
|
|||||||
5
electron/utils.js
vendored
5
electron/utils.js
vendored
@ -291,12 +291,11 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
onBeforeUnload(event, app) {
|
onBeforeUnload(event, app) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const sender = event.sender
|
const contents = app.webContents
|
||||||
const contents = sender.webContents
|
|
||||||
if (contents != null) {
|
if (contents != null) {
|
||||||
contents.executeJavaScript('if(typeof window.__onBeforeUnload === \'function\'){window.__onBeforeUnload()}', true).then(options => {
|
contents.executeJavaScript('if(typeof window.__onBeforeUnload === \'function\'){window.__onBeforeUnload()}', true).then(options => {
|
||||||
if (this.isJson(options)) {
|
if (this.isJson(options)) {
|
||||||
let choice = dialog.showMessageBoxSync(sender, options)
|
let choice = dialog.showMessageBoxSync(app, options)
|
||||||
if (choice === 1) {
|
if (choice === 1) {
|
||||||
contents.executeJavaScript('if(typeof window.__removeBeforeUnload === \'function\'){window.__removeBeforeUnload()}', true).catch(() => {});
|
contents.executeJavaScript('if(typeof window.__removeBeforeUnload === \'function\'){window.__removeBeforeUnload()}', true).catch(() => {});
|
||||||
resolve()
|
resolve()
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
"css-loader": "^6.7.2",
|
"css-loader": "^6.7.2",
|
||||||
"dexie": "^3.2.3",
|
"dexie": "^3.2.3",
|
||||||
"echarts": "^5.2.2",
|
"echarts": "^5.2.2",
|
||||||
"element-sea": "^2.15.10-5",
|
"element-sea": "^2.15.10-6",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"highlight.js": "^11.7.0",
|
"highlight.js": "^11.7.0",
|
||||||
"inquirer": "^8.2.0",
|
"inquirer": "^8.2.0",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user