更新依赖

This commit is contained in:
lyswhut
2022-07-17 12:40:21 +08:00
parent a2c613d380
commit 2a716e4d5a
4 changed files with 235 additions and 224 deletions
+2 -1
View File
@@ -79,6 +79,7 @@ export const b64DecodeUnicode = str => {
}
const encodeNames = {
' ': ' ',
'&': '&',
'&lt;': '<',
'&gt;': '>',
@@ -86,7 +87,7 @@ const encodeNames = {
'&apos;': "'",
'&#039;': "'",
}
export const decodeName = (str = '') => str?.replace(/(?:&amp;|&lt;|&gt;|&quot;|&apos;|&#039;)/gm, s => encodeNames[s]) || ''
export const decodeName = (str = '') => str?.replace(/(?:&amp;|&lt;|&gt;|&quot;|&apos;|&#039;|&nbsp;)/gm, s => encodeNames[s]) || ''
const easeInOutQuad = (t, b, c, d) => {
t /= d / 2
+30 -2
View File
@@ -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),
// // },
// // }
// })
// })
// },
}