mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: resolve ts errors and warnings
This commit is contained in:
@@ -117,7 +117,7 @@ function searchHistoryList() {
|
||||
}
|
||||
|
||||
res.data.list.forEach((item: HistorySearchItem) => {
|
||||
historyList.push(item as HistoryItem)
|
||||
historyList.push(item as unknown as HistoryItem)
|
||||
})
|
||||
|
||||
noMoreContent.value = false
|
||||
@@ -154,23 +154,30 @@ function deleteHistoryItem(index: number, historyItem: HistoryItem) {
|
||||
*/
|
||||
function getHistoryUrl(item: HistoryItem) {
|
||||
// anime
|
||||
if (item.history.business === 'pgc')
|
||||
if (item.history.business === 'pgc') {
|
||||
return removeHttpFromUrl(item.uri)
|
||||
}
|
||||
// video
|
||||
else if (item.history.business === 'archive')
|
||||
else if (item.history.business === 'archive') {
|
||||
return removeHttpFromUrl(item.history.bvid)
|
||||
else if (item.history.business === 'live')
|
||||
}
|
||||
else if (item.history.business === 'live') {
|
||||
return `//live.bilibili.com/${item.history.oid}`
|
||||
else if (item.history.business === 'article')
|
||||
if (item.history.cid == 0)
|
||||
}
|
||||
else if (item.history.business === 'article') {
|
||||
if (item.history.cid === 0)
|
||||
return `//www.bilibili.com/read/cv${item.history.oid}`
|
||||
else return `//www.bilibili.com/read/cv${item.history.cid}`
|
||||
else
|
||||
return `//www.bilibili.com/read/cv${item.history.cid}`
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function getHistoryItemCover(item: HistoryItem) {
|
||||
if (item.history.business === 'article')
|
||||
return removeHttpFromUrl(`${item.covers[0]}`)
|
||||
if (item.history.business === 'article') {
|
||||
if (item.covers)
|
||||
return removeHttpFromUrl(`${item.covers[0]}`)
|
||||
}
|
||||
|
||||
return removeHttpFromUrl(item.cover)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user