diff --git a/frontend/src/App.js b/frontend/src/App.js index cf76a624..bfd39190 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -108,6 +108,7 @@ function MeetingRoom() { const [content, setContent] = useState(''); const [participants, setParticipants] = useState([]); const [meeting, setMeeting] = useState(null); + const [hoveredSeat, setHoveredSeat] = useState(null); const token = localStorage.getItem('token'); useEffect(() => { @@ -152,17 +153,18 @@ function MeetingRoom() { } }; - const mentionAgent = async () => { - const targetAgentId = prompt('@哪个 Agent?输入 agent_id:'); - if (!targetAgentId || !content.trim()) return; + const mentionAgent = async (targetAgentId, agentName) => { + const target = targetAgentId || prompt('@哪个 Agent?输入 agent_id:'); + if (!target || !content.trim()) return; + const name = agentName || target; try { await axios.post(`${API_BASE}/meetings/${id}/mention_agent/`, { - target_agent_id: targetAgentId, content, + target_agent_id: target, content, sender_name: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')).username : 'User' }); setContent(''); fetchMessages(); - alert(`✅ 已 @${targetAgentId}`); + alert(`✅ 已 @${name}`); } catch (error) { alert('发送失败:' + (error.response?.data?.error || error.message)); } @@ -230,7 +232,19 @@ function MeetingRoom() {