fix: 修改直播和监控逻辑

This commit is contained in:
阿梦 2026-05-15 19:17:56 +08:00
parent 3c70e1d05b
commit 3bfb7c467b
2 changed files with 6 additions and 3 deletions

View File

@ -227,12 +227,14 @@ export const syncStudentScreenShareState = async (state: unknown) => {
} }
const sessionKey = getMonitorSessionKey(msg) const sessionKey = getMonitorSessionKey(msg)
if (monitorState === 1 && sessionKey && monitorSessionId === sessionKey) {
// 已在监控中:仅刷新连接参数,不先 stop 再 start与老师 screenShareState 同步一致)
if (monitorState === 1) {
if (sessionKey) monitorSessionId = sessionKey
applyStudentShareStart(msg) applyStudentShareStart(msg)
return return
} }
stopClassMonitor()
monitorSessionId = sessionKey monitorSessionId = sessionKey
monitorState = 1 monitorState = 1
if (!applyStudentShareStart(msg)) { if (!applyStudentShareStart(msg)) {

View File

@ -123,7 +123,8 @@ export const userStore = defineStore('user', () => {
system.value.isLock = info.lockFlag === 0 system.value.isLock = info.lockFlag === 0
} }
if (hasMonitorState) { // 有 studentScreenShareState 时以其为准,避免与旧 monitorState 重复 stop/start
if (hasMonitorState && !hasStudentScreenShareState) {
syncClassMonitorState(info) syncClassMonitorState(info)
} }