mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 13:42:09 +08:00
优化缓存
This commit is contained in:
parent
cde7863060
commit
53b75c31cc
3
app.js
3
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'))
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NeteaseCloudMusicApi",
|
||||
"version": "2.6.8",
|
||||
"version": "2.6.9",
|
||||
"description": "网易云音乐 NodeJS 版 API",
|
||||
"scripts": {
|
||||
"start": "node app.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
|
||||
})
|
||||
|
@ -7,7 +7,6 @@ router.get('/', (req, res) => {
|
||||
const data = {
|
||||
csrf_token: ''
|
||||
}
|
||||
|
||||
createWebAPIRequest(
|
||||
'music.163.com',
|
||||
'/weapi/v1/radio/get',
|
||||
|
Loading…
x
Reference in New Issue
Block a user