From 26f5738d360e2fbc21e6e84014c343b32bce7011 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Wed, 2 Sep 2026 10:43:40 +0800 Subject: [PATCH] fix: pass streamSessionId when fetching live play URL Require session id in getLivePlayURL and guard Monitor refresh so play-url requests match the backend contract. --- src/api/live.js | 6 ++++-- src/composables/useMonitorLive.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/live.js b/src/api/live.js index 28cbe10..f6311bc 100644 --- a/src/api/live.js +++ b/src/api/live.js @@ -4,8 +4,10 @@ export function joinLive(dockId, payload = {}) { return request.post(`/v1/live/${dockId}/sessions`, payload) } -export function getLivePlayURL(dockId) { - return request.get(`/v1/live/${dockId}/play-url`) +export function getLivePlayURL(dockId, sessionId) { + return request.get(`/v1/live/${dockId}/play-url`, { + params: { streamSessionId: sessionId } + }) } export function heartbeatLive(dockId, sessionId) { diff --git a/src/composables/useMonitorLive.js b/src/composables/useMonitorLive.js index 108cb3a..6b5098f 100644 --- a/src/composables/useMonitorLive.js +++ b/src/composables/useMonitorLive.js @@ -46,8 +46,8 @@ export function useMonitorLive({ getDockId, ui, getLivePlayer }) { } async function refreshPlayURL() { - if (!live.dockId) return - const play = await getLivePlayURL(live.dockId) + if (!live.dockId || !live.session?.id) return + const play = await getLivePlayURL(live.dockId, live.session.id) live.playUrl = play.playUrl || '' }