mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: cannot open certain links on History page and HistoryPop (#602)
close #602
This commit is contained in:
@@ -6,7 +6,7 @@ import { getCSRF, removeHttpFromUrl } from '~/utils/main'
|
||||
import { calcCurrentTime } from '~/utils/dataFormatter'
|
||||
import { Business } from '~/models/history/history'
|
||||
import type { List as HistoryItem, HistoryResult } from '~/models/history/history'
|
||||
import type { List as HistorySearchItem, HistorySearchResult } from '~/models/history/historySearch'
|
||||
import type { List as HistorySearchItem, HistorySearchResult } from '~/models/video/historySearch'
|
||||
import API from '~/background/msg.define'
|
||||
|
||||
const { t } = useI18n()
|
||||
@@ -136,20 +136,21 @@ function deleteHistoryItem(index: number, historyItem: HistoryItem) {
|
||||
* @return {string} url
|
||||
*/
|
||||
function getHistoryUrl(item: HistoryItem): string {
|
||||
// anime
|
||||
if (item.history.business === 'pgc') {
|
||||
return removeHttpFromUrl(item.uri)
|
||||
}
|
||||
// video
|
||||
else if (item.history.business === Business.ARCHIVE) {
|
||||
if (item.uri)
|
||||
return item.uri
|
||||
|
||||
// Video
|
||||
if (item.history.business === Business.ARCHIVE) {
|
||||
if (item?.videos && item.videos > 0)
|
||||
return `//www.bilibili.com/video/${item.history.bvid}?p=${item.history.page}`
|
||||
return item.history.bvid
|
||||
return `//www.bilibili.com/video/${item.history.bvid}`
|
||||
}
|
||||
else if (item.history.business === 'live') {
|
||||
// Live
|
||||
else if (item.history.business === Business.LIVE) {
|
||||
return `//live.bilibili.com/${item.history.oid}`
|
||||
}
|
||||
else if (item.history.business === 'article' || item.history.business === 'article-list') {
|
||||
// Article
|
||||
else if (item.history.business === Business.ARTICLE || item.history.business === Business.ARTICLE_LIST) {
|
||||
if (item.history.cid === 0)
|
||||
return `//www.bilibili.com/read/cv${item.history.oid}`
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user