获取room_id兼容blanc原版直播间

This commit is contained in:
xiezibuyongbi 2025-08-11 22:08:32 +08:00 committed by GitHub
parent 4840c2f83d
commit 992b24a5e2
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] : ''
}