会议结束

This commit is contained in:
2025-12-27 17:57:08 +08:00
parent 0fb7a4ffb2
commit 50df8495c7
2 changed files with 33 additions and 17 deletions

View File

@@ -185,7 +185,7 @@ import { Client } from '@stomp/stompjs'
// WebSocket配置 (通过Nginx代理访问网关再到workcase服务) // WebSocket配置 (通过Nginx代理访问网关再到workcase服务)
// SockJS URL (http://) // SockJS URL (http://)
const getWsUrl = () => { const getWsUrl = () => {
const token = localStorage.getItem('token') || '' const token = JSON.parse(localStorage.getItem('token')).value || ''
const protocol = window.location.protocol const protocol = window.location.protocol
const host = window.location.host const host = window.location.host
return `${protocol}//${host}/api/urban-lifeline/workcase/ws/chat-sockjs?token=${encodeURIComponent(token)}` return `${protocol}//${host}/api/urban-lifeline/workcase/ws/chat-sockjs?token=${encodeURIComponent(token)}`

View File

@@ -235,25 +235,41 @@ const joinMeeting = async () => {
} }
} }
// 处理离开会议(不结束 // 处理离开会议(更新会议结束时间
const handleLeaveMeeting = () => { const handleLeaveMeeting = async () => {
console.log('[JitsiMeetingView] 处理离开会议,返回聊天室:', roomId.value) // 强制更新: 修改时间 2025-12-27 09:45
console.log('[JitsiMeetingView] 处理离开会议meetingId:', meetingId.value, 'roomId:', roomId.value)
// 清理 Jitsi API try {
if (jitsiApi) { // 调用后端接口更新会议结束时间
jitsiApi.dispose() if (meetingId.value) {
jitsiApi = null console.log('[JitsiMeetingView] 调用结束会议API更新结束时间')
} const result = await workcaseChatAPI.endVideoMeeting(meetingId.value)
if (result.success) {
console.log('[JitsiMeetingView] 会议结束时间已更新:', result.data)
} else {
console.warn('[JitsiMeetingView] 更新会议结束时间失败:', result.message)
}
}
} catch (err) {
console.error('[JitsiMeetingView] 更新会议结束时间异常:', err)
} finally {
// 清理 Jitsi API
if (jitsiApi) {
jitsiApi.dispose()
jitsiApi = null
}
// 如果有roomId返回到对应的聊天室 // 如果有roomId返回到对应的聊天室
if (roomId.value) { if (roomId.value) {
router.push(`/chatRoom?roomId=${roomId.value}`) router.push(`/chatRoom?roomId=${roomId.value}`)
} else {
// 没有roomId尝试返回上一页或关闭窗口
if (window.history.length > 1) {
router.back()
} else { } else {
window.close() // 没有roomId尝试返回上一页或关闭窗口
if (window.history.length > 1) {
router.back()
} else {
window.close()
}
} }
} }
} }