内置百度源歌曲图片、歌词获取

This commit is contained in:
lyswhut
2019-09-17 21:36:46 +08:00
parent d19569131c
commit c8240448c6
3 changed files with 25 additions and 27 deletions
-22
View File
@@ -14,28 +14,6 @@ const api_test = {
})
return requestObj
},
getPic(songInfo, size = '500') {
const requestObj = httpFatch(`http://ts.tempmusic.tk/pic/bd/${songInfo.songmid}/${size}`, {
method: 'get',
timeout,
headers,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 0 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail))
})
return requestObj
},
getLyric(songInfo) {
const requestObj = httpFatch(`http://ts.tempmusic.tk/lrc/bd/${songInfo.songmid}`, {
method: 'get',
timeout,
headers,
})
requestObj.promise = requestObj.promise.then(({ body }) => {
return body.code === 0 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail))
})
return requestObj
},
}
export default api_test