1. Get playlist data
export function getDiscList() {
const url = "/api/getDiscList"
const data = Object.assign({}, commonParams, {
platform: "yqq",
hostUin: 0,
sin: 0,
ein: 29,
sortId: 5,
needNewCode: 0,
categoryId: 10000000,
rnd: Math.random(),
format: "json"
})
return axios.get(url, {
params: data
}).then((res) => {
return Promise.resolve(res.data)
})
}
2webpack.dev.js
const express = require("express")
const app = express()
const apiRoutes = express.Router()
const axios = require("axios")
app.use("/api", apiRoutes)
before(app) {
app.get("/api/getDiscList", (req, res) => {
var url = "https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg"
axios.get(url, {
headers: {
referer: "https://c.y.qq.com/",
host: "c.y.qq.com"
},
params: req.query
}).then((response) => {
res.json(response.data)
}).catch((e) => {
console.log(e)
})
})
}
}