From 6d3508c62a388546ec9971db83c6cfb2cabbe1f5 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Wed, 22 Jun 2022 14:29:18 +0800 Subject: [PATCH] fix: change port to workaround 21H2's port (#1706) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: change port to 35216 → workaround 21H2's port * style: with restyled (#1707) * Restyled by clang-format * Restyled by prettier * fix: change 21232 to 41342 Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io --- .env.example | 2 +- .github/workflows/build.yaml | 2 +- src/background.js | 10 +++++----- src/electron/services.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 7c0058a..9eeada5 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:10754 +VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:35216 VUE_APP_LASTFM_API_KEY=09c55292403d961aa517ff7f5e8a3d9c VUE_APP_LASTFM_API_SHARED_SECRET=307c9fda32b3904e53654baff215cb67 DEV_SERVER_PORT=20201 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ff3fd3b..dacb51f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -82,7 +82,7 @@ jobs: uses: samuelmeuli/action-electron-builder@v1.6.0 env: VUE_APP_ELECTRON_API_URL: /api - VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:10754 + VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:35216 VUE_APP_LASTFM_API_KEY: 09c55292403d961aa517ff7f5e8a3d9c VUE_APP_LASTFM_API_SHARED_SECRET: 307c9fda32b3904e53654baff215cb67 with: diff --git a/src/background.js b/src/background.js index 1d4fdba..1a98c6b 100644 --- a/src/background.js +++ b/src/background.js @@ -66,7 +66,7 @@ const closeOnLinux = (e, win, store) => { win.hide(); //调用 最小化实例方法 } else if (result.response === 1) { win = null; - app.exit(); //exit()直接关闭客户端,不会执行quit(); + app.exit(); // exit()直接关闭客户端,不会执行quit(); } }) .catch(err => { @@ -153,7 +153,7 @@ class Background { const expressApp = express(); expressApp.use('/', express.static(__dirname + '/')); - expressApp.use('/api', expressProxy('http://127.0.0.1:10754')); + expressApp.use('/api', expressProxy('http://127.0.0.1:35216')); expressApp.use('/player', (req, res) => { this.window.webContents .executeJavaScript('window.yesplaymusic.player') @@ -166,7 +166,7 @@ class Background { }); }); }); - this.expressApp = expressApp.listen(27232, '127.0.0.1'); + this.expressApp = expressApp.listen(41342, '127.0.0.1'); } createWindow() { @@ -257,8 +257,8 @@ class Background { createProtocol('app'); this.window.loadURL( showLibraryDefault - ? 'http://localhost:27232/#/library' - : 'http://localhost:27232' + ? 'http://localhost:41342/#/library' + : 'http://localhost:41342' ); } } diff --git a/src/electron/services.js b/src/electron/services.js index 1840672..d5c93d8 100644 --- a/src/electron/services.js +++ b/src/electron/services.js @@ -7,7 +7,7 @@ export async function startNeteaseMusicApi() { // Load the NCM API. await server.serveNcmApi({ - port: 10754, + port: 35216, moduleDefs: require('../ncmModDef'), }); }