🔧 修复:进入会议时自动加入
变更: - joinMeeting 先获取会议信息 - 传递 invite_code 到后端 - 加入后刷新参会者列表
This commit is contained in:
@@ -270,10 +270,17 @@ function MeetingRoom() {
|
||||
|
||||
const joinMeeting = async () => {
|
||||
try {
|
||||
// 先获取会议信息
|
||||
if (!meeting) {
|
||||
const res = await axios.get(`${API_BASE}/meetings/${id}/`);
|
||||
setMeeting(res.data);
|
||||
}
|
||||
// 尝试加入会议(如果还没加入)
|
||||
await axios.post(`${API_BASE}/meetings/${id}/join/`, {
|
||||
invite_code: meeting?.invite_code
|
||||
});
|
||||
// 刷新参会者列表
|
||||
fetchParticipants();
|
||||
} catch (error) {
|
||||
// 可能已经加入了,忽略错误
|
||||
console.log('加入会议:', error?.response?.data?.error || '已加入');
|
||||
|
||||
Reference in New Issue
Block a user