From 53b75c31cca33793019069fa766e81ba06fea19f Mon Sep 17 00:00:00 2001 From: binaryify Date: Thu, 17 Aug 2017 16:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 ++- package.json | 2 +- router/loginCellphone.js | 3 +-- router/personal_fm.js | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index b4c9dda..1cbd22e 100644 --- a/app.js +++ b/app.js @@ -17,8 +17,9 @@ let cache = apicache.middleware // } // next() // }) +const onlyStatus200 = (req, res) => res.statusCode === 200 -app.use(cache('2 minutes')) +app.use(cache('2 minutes', onlyStatus200)) app.use(express.static('public')) diff --git a/package.json b/package.json index fcae6f9..b3dacf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "2.6.8", + "version": "2.6.9", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/router/loginCellphone.js b/router/loginCellphone.js index f872aff..38c2d2f 100644 --- a/router/loginCellphone.js +++ b/router/loginCellphone.js @@ -13,7 +13,6 @@ router.get('/', (req, res) => { password: md5sum.digest('hex'), rememberLogin: 'true' } - createWebAPIRequest( 'music.163.com', '/weapi/login/cellphone', @@ -21,7 +20,7 @@ router.get('/', (req, res) => { data, cookie, (music_req, cookie) => { - console.log(music_req) + // console.log(music_req) res.set({ 'Set-Cookie': cookie }) diff --git a/router/personal_fm.js b/router/personal_fm.js index c605280..a6774e4 100644 --- a/router/personal_fm.js +++ b/router/personal_fm.js @@ -7,7 +7,6 @@ router.get('/', (req, res) => { const data = { csrf_token: '' } - createWebAPIRequest( 'music.163.com', '/weapi/v1/radio/get', -- GitLab