Skip to content

Commit ef9bb3f

Browse files
committed
app ready
1
1 parent a77f77c commit ef9bb3f

File tree

4 files changed

+10
-77
lines changed

4 files changed

+10
-77
lines changed

src/background.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,15 @@ async function createWindow() {
5555
}, {
5656
label: 'Exit',
5757
click: () => {
58-
loadingWindow.close()
5958
mainWindow.close()
6059
},
6160
}];
6261
// 创建托盘实例
6362
if (process.env.WEBPACK_DEV_SERVER_URL)
64-
const iconPath = nativeImage.createFromPath(path.join(__dirname, '../src/assets/', 'logo.png'))
63+
appTray = new Tray(path.join(__dirname, '../src/assets/', 'logo.png'));
6564
else
66-
const iconPath = nativeImage.createFromPath(path.join('app://./icon.png'))
67-
appTray = new Tray(iconPath);
65+
appTray = new Tray(path.join(app.getAppPath(), '/icon.png'));
66+
6867
// 图标的上下文菜单
6968
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate);
7069

@@ -81,7 +80,6 @@ async function createWindow() {
8180

8281
// Load the url of the dev server if in development mode
8382

84-
createProtocol('app')
8583
if (process.env.WEBPACK_DEV_SERVER_URL)
8684
mainWindow.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
8785
else mainWindow.loadURL("app://./index.html")
@@ -113,6 +111,7 @@ async function createWindow() {
113111
mainWindow.maximize();
114112
}
115113
})
114+
116115
// 主进程监听打开托盘事件
117116
ipcMain.on('hide-in-bar', () => {
118117
mainWindow.hide()
@@ -176,12 +175,17 @@ async function createLoadingWindow() {
176175
webSecurity: false,
177176
}
178177
})
179-
loadingWindow.loadFile(path.join(__dirname, '../public/', 'cover.html'))
178+
createProtocol('app')
179+
if (process.env.WEBPACK_DEV_SERVER_URL)
180+
loadingWindow.loadURL(path.join(__dirname, '../public/', 'cover.html'))
181+
else loadingWindow.loadURL("app://./cover.html")
182+
180183
loadingWindow.show()
181184
loadingWindow.focus()
182185
createWindow()
183186
loadingWindow.setAlwaysOnTop(!loadingWindow.isAlwaysOnTop())
184187
mainWindow.hide()
188+
185189
ipcMain.on('loading-finish', () => {
186190
setTimeout(() => {
187191
mainWindow.show()

src/user/appConfig copy.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/user/appConfig.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/views/Home.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default {
3535
<style scoped lang="postcss">
3636
.home {
3737
@apply w-full h-full relative;
38-
min-height: calc(100vh -);
3938
}
4039
4140
.topContainer {

0 commit comments

Comments
 (0)