(data)
| 5 | |
| 6 | class ChatAPI { |
| 7 | static async sendMessage(data) { |
| 8 | try { |
| 9 | const response = await axios.post(`${API_BASE_URL}/chat`, data, { |
| 10 | headers: { |
| 11 | 'Content-Type': 'application/json', |
| 12 | }, |
| 13 | }); |
| 14 | return response.data; |
| 15 | } catch (error) { |
| 16 | console.error('发送消息失败:', error); |
| 17 | throw error; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | static async sendMessageWithAttachments(formData) { |
| 22 | try { |