更新依赖
This commit is contained in:
@@ -79,6 +79,7 @@ export const b64DecodeUnicode = str => {
|
||||
}
|
||||
|
||||
const encodeNames = {
|
||||
' ': ' ',
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
@@ -86,7 +87,7 @@ const encodeNames = {
|
||||
''': "'",
|
||||
''': "'",
|
||||
}
|
||||
export const decodeName = (str = '') => str?.replace(/(?:&|<|>|"|'|')/gm, s => encodeNames[s]) || ''
|
||||
export const decodeName = (str = '') => str?.replace(/(?:&|<|>|"|'|'| )/gm, s => encodeNames[s]) || ''
|
||||
|
||||
const easeInOutQuad = (t, b, c, d) => {
|
||||
t /= d / 2
|
||||
|
||||
@@ -78,6 +78,7 @@ export default {
|
||||
body = objStr2JSON(body)
|
||||
// console.log(body)
|
||||
if (!body.musiclist) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
body.name = decodeName(body.name)
|
||||
return {
|
||||
list: this.filterListDetail(body.musiclist, body.name, body.albumid),
|
||||
page,
|
||||
@@ -87,11 +88,38 @@ export default {
|
||||
info: {
|
||||
name: body.name,
|
||||
img: body.img || body.hts_img,
|
||||
desc: body.info,
|
||||
author: body.artist,
|
||||
desc: decodeName(body.info),
|
||||
author: decodeName(body.artist),
|
||||
// play_count: this.formatPlayCount(body.playnum),
|
||||
},
|
||||
}
|
||||
})
|
||||
},
|
||||
// getAlbumListDetail(id, page, retryNum = 0) {
|
||||
// if (retryNum > 2) return Promise.reject(new Error('try max num'))
|
||||
// return tokenRequest(`http://www.kuwo.cn/api/www/album/albumInfo?albumId=${id}&pn=${page}&rn=${this.limit_song}&httpsStatus=1`).then((resp) => {
|
||||
// return resp.promise.then(({ statusCode, body }) => {
|
||||
// console.log(body)
|
||||
// return Promise.reject(new Error('failed'))
|
||||
// // if (statusCode !== 200) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
// // const data = body.data
|
||||
// // console.log(data)
|
||||
// // if (!data.musicList) return this.getAlbumListDetail(id, page, ++retryNum)
|
||||
// // return {
|
||||
// // list: this.filterListDetail(data.musiclist),
|
||||
// // page,
|
||||
// // limit: this.limit_song,
|
||||
// // total: data.total,
|
||||
// // source: 'kw',
|
||||
// // info: {
|
||||
// // name: data.album,
|
||||
// // img: data.pic,
|
||||
// // desc: data.albuminfo,
|
||||
// // author: data.artist,
|
||||
// // play_count: this.formatPlayCount(data.playCnt),
|
||||
// // },
|
||||
// // }
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user