From ef50d90a18a5abbd4e38c6eaf5cb0e6226c6a0a6 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 31 Mar 2020 15:46:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=8F=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 4 +++- src/renderer/utils/music/mg/lyric.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 9c8f24bf..744324e6 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -15,8 +15,11 @@ app.on('second-instance', (event, argv, cwd) => { } }) +const isDev = process.env.NODE_ENV !== 'production' + app.on('web-contents-created', (event, contents) => { contents.on('will-navigate', (event, navigationUrl) => { + if (isDev) return console.log('navigation to url:', navigationUrl) event.preventDefault() }) contents.on('new-window', async(event, navigationUrl) => { @@ -27,7 +30,6 @@ app.on('web-contents-created', (event, contents) => { }) }) -const isDev = process.env.NODE_ENV !== 'production' // https://github.com/electron/electron/issues/18397 app.allowRendererProcessReuse = !isDev diff --git a/src/renderer/utils/music/mg/lyric.js b/src/renderer/utils/music/mg/lyric.js index 65191f79..330aa10d 100644 --- a/src/renderer/utils/music/mg/lyric.js +++ b/src/renderer/utils/music/mg/lyric.js @@ -2,7 +2,7 @@ import { httpFetch } from '../../request' export default { getLyric(songInfo, tryNum = 0) { - console.log(songInfo.copyrightId) + // console.log(songInfo.copyrightId) if (songInfo.lrcUrl) { let requestObj = httpFetch(songInfo.lrcUrl) requestObj.promise = requestObj.promise.then(({ body, statusCode }) => {