(formData)
| 19 | } |
| 20 | |
| 21 | static async sendMessageWithAttachments(formData) { |
| 22 | try { |
| 23 | const response = await axios.post(`${API_BASE_URL}/chat/with-attachments`, formData, { |
| 24 | headers: { |
| 25 | 'Content-Type': 'multipart/form-data', |
| 26 | }, |
| 27 | }); |
| 28 | return response.data; |
| 29 | } catch (error) { |
| 30 | console.error('发送带附件的消息失败:', error); |
| 31 | throw error; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * 流式发送消息(SSE),支持附件。 |