mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 03:22:08 +08:00
格式化代码
This commit is contained in:
@ -1,27 +1,27 @@
|
||||
//comment like
|
||||
const express = require("express")
|
||||
//comment like
|
||||
const express = require('express')
|
||||
const router = express()
|
||||
const { createWebAPIRequest } = require("../util/util")
|
||||
const { createWebAPIRequest } = require('../util/util')
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
router.get('/', (req, res) => {
|
||||
const cookie = req.get('Cookie') ? req.get('Cookie') : ''
|
||||
const cid = req.query.cid //评论 id
|
||||
const id=req.query.id// 歌曲 id
|
||||
const typeMap={
|
||||
0:"R_SO_4_",//歌曲
|
||||
1:"R_MV_5_",//mv
|
||||
2:"A_PL_0_",//歌单
|
||||
3:"R_AL_3_",//专辑
|
||||
4:"A_DJ_1_",//电台
|
||||
const cid = req.query.cid //评论 id
|
||||
const id = req.query.id // 歌曲 id
|
||||
const typeMap = {
|
||||
0: 'R_SO_4_', //歌曲
|
||||
1: 'R_MV_5_', //mv
|
||||
2: 'A_PL_0_', //歌单
|
||||
3: 'R_AL_3_', //专辑
|
||||
4: 'A_DJ_1_' //电台
|
||||
}
|
||||
const type=typeMap[req.query.type]
|
||||
const type = typeMap[req.query.type]
|
||||
const data = {
|
||||
"threadId": `${type}${id}`,
|
||||
commentId:cid,
|
||||
"csrf_token": ""
|
||||
threadId: `${type}${id}`,
|
||||
commentId: cid,
|
||||
csrf_token: ''
|
||||
}
|
||||
const action=(req.query.t==1?'like':'unlike')
|
||||
|
||||
const action = req.query.t == 1 ? 'like' : 'unlike'
|
||||
|
||||
const url = `/weapi/v1/comment/${action}`
|
||||
createWebAPIRequest(
|
||||
'music.163.com',
|
||||
@ -34,6 +34,4 @@ router.get("/", (req, res) => {
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
|
||||
module.exports = router
|
||||
module.exports = router
|
||||
|
Reference in New Issue
Block a user