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',