|
|
@ -12,7 +12,8 @@ Shared.data = { |
|
|
|
mainWindow: null, |
|
|
|
floatWindow: null, |
|
|
|
miniWindow: null, |
|
|
|
forceClose: false |
|
|
|
forceClose: false, |
|
|
|
lastChoice: -1, |
|
|
|
} |
|
|
|
console.log('asdasadsads') |
|
|
|
/** |
|
|
@ -28,7 +29,6 @@ console.log('asdasadsads') |
|
|
|
|
|
|
|
|
|
|
|
const winURL = process.env.NODE_ENV === 'development' ? `http://localhost:${process.env.PORT}/#/` : `file://${__dirname}/index.html` |
|
|
|
let lastChoice = -1 |
|
|
|
|
|
|
|
function createWindow() { |
|
|
|
/** |
|
|
@ -56,7 +56,7 @@ function createWindow() { |
|
|
|
Shared.data.mainWindow = null |
|
|
|
app.quit() |
|
|
|
} else if (Shared.data.mainWindow) { |
|
|
|
if (lastChoice === 1) { |
|
|
|
if (Shared.data.lastChoice === 1) { |
|
|
|
if (Shared.data.miniWindow) { |
|
|
|
Shared.data.mainWindow.hide() // 调用 最小化实例方法
|
|
|
|
} else { |
|
|
@ -73,7 +73,7 @@ function createWindow() { |
|
|
|
buttons: ['没事', '最小化到托盘', '直接退出'] |
|
|
|
}) |
|
|
|
if (choice === 1) { |
|
|
|
lastChoice = 1 |
|
|
|
Shared.data.lastChoice = 1 |
|
|
|
if (Shared.data.miniWindow) { |
|
|
|
Shared.data.mainWindow.hide() // 调用 最小化实例方法
|
|
|
|
} else { |
|
|
|