fix 播放跳转

This commit is contained in:
jxxghp
2024-01-03 18:39:39 +08:00
parent 6e2b12501f
commit d09a21114d

View File

@@ -417,8 +417,20 @@ function handleSearch(area: string) {
}
// 跳转播放页面
function handlePlay() {
window.open(`${import.meta.env.VITE_API_BASE_URL}mediaserver/play/${existsItemId.value}`, '_blank')
async function handlePlay() {
// 获取播放链接地址
try {
const result: { [key: string]: any } = await api.get(
`mediaserver/play/${existsItemId.value}`,
)
if (result?.success)
window.open(result.data?.url, '_blank')
else
$toast.error(`获取播放链接失败:${result.message}`)
}
catch (error) {
console.error(error)
}
}
onBeforeMount(() => {