diff --git a/.env.example b/.env.example index c31b035c61..7c0058aafb 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ VUE_APP_NETEASE_API_URL=/api VUE_APP_ELECTRON_API_URL=/api -VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:3000 +VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:10754 VUE_APP_LASTFM_API_KEY=09c55292403d961aa517ff7f5e8a3d9c VUE_APP_LASTFM_API_SHARED_SECRET=307c9fda32b3904e53654baff215cb67 DEV_SERVER_PORT=20201 diff --git a/package.json b/package.json index 5edf24657c..525884913a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yesplaymusic", - "version": "0.4.1", + "version": "0.4.2", "private": true, "description": "A third party music player for Netease Music", "author": "hawtim", diff --git a/src/background.js b/src/background.js index 411df2007b..75922c8616 100644 --- a/src/background.js +++ b/src/background.js @@ -87,7 +87,7 @@ class Background { }); this.neteaseMusicAPI = null; this.expressApp = null; - this.willQuitApp = isMac ? false : true; + this.willQuitApp = !isMac; this.init(); } @@ -482,6 +482,18 @@ class Background { // unregister all global shortcuts globalShortcut.unregisterAll(); }); + + if (!isMac) { + app.on('second-instance', (e, cl, wd) => { + if (this.window) { + this.window.show(); + if (this.window.isMinimized()) { + this.window.restore(); + } + this.window.focus(); + } + }); + } } } diff --git a/src/views/settings.vue b/src/views/settings.vue index 1112ebab66..b472a4511f 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -35,7 +35,7 @@ - +