🔧 修复:组队团战时创建所有龙虾座位

问题:
- 登录选了 N 只龙虾,但创建会议只有人类座位

修复:
- 前端:创建会议时传递 host_agent_id(第一只龙虾)
- 后端:根据 host_agent_id 创建龙虾参会者
- 优化:只有没有龙虾时才添加虚拟坐席

结果:
 单枪匹马 - 1 个座位
 组队团战(2 龙虾)- 3 个座位
 独当一面(1 龙虾)- 1 个座位
This commit is contained in:
2026-04-04 16:50:30 +08:00
parent 65000664ef
commit 1954a768f3
2 changed files with 9 additions and 4 deletions

View File

@@ -167,9 +167,14 @@ function MeetingList() {
const createMeeting = async (e) => {
e.preventDefault();
try {
// 获取当前登录的龙虾
const sessions = JSON.parse(localStorage.getItem('sessions') || '[]');
const agentIds = sessions.filter(s => s.session_type === 'agent').map(s => s.agent_id);
const res = await axios.post(`${API_BASE}/meetings/`, {
topic,
auto_add_virtual_agents: autoAddAgents
auto_add_virtual_agents: !autoAddAgents ? false : agentIds.length === 0, // 如果没有龙虾才添加虚拟的
host_agent_id: agentIds.length > 0 ? agentIds[0] : null
});
navigate(`/meeting/${res.data.id}`);
} catch (error) {