Merge pull request #5328 from kkkkkkkk566/preview-fixes

获取room_id兼容blanc原版直播间
This commit is contained in:
Grant Howard 2025-08-17 20:54:25 +08:00 committed by GitHub
commit 2b97931ea0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,11 @@ import { getCsrf, getUID } from '@/core/utils'
// 获取当前直播间号
export function getLiveRoomId(): string {
const matched = location.href.match(/live.bilibili.com\/(\d+)/)
let matched = location.href.match(/live.bilibili.com\/(\d+)/)
if (matched) {
return matched[1]
}
matched = location.href.match(/live.bilibili.com\/blanc\/(\d+)/)
return matched ? matched[1] : ''
}