提交 86e54c00 编写于 作者: C CeBkCn 提交者: GitHub

Add getPlaylists

上级 c2460b03
import request from 'request'
import { origin, globalOption } from '../config'
import { deepCopy } from '../util'
const getPlaylists = (id, callback) => {
const option = deepCopy(globalOption)
const url = `${origin}/api/playlist/detail?id=${id}`
const method = 'get'
Object.assign(option, {url, method})
request(option, (err, res, body) => {
if(!err && res.statusCode == 200) {
let info = JSON.parse(body)
callback && callback(JSON.stringify(info, '', 2))
} else {
console.error(err);
}
})
}
export { Playlists }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册