This commit is contained in:
2025-06-26 10:06:24 +08:00
parent 21b4793a05
commit d70a9ab99f

View File

@@ -662,7 +662,10 @@
let token = sessionStorage.getItem('token');
if (socket && socket.readyState === WebSocket.OPEN) {
axios.post('/api/im/send-message', message, {
axios.post('/api/im/send-message', {
message_type: 'text',
data: message
}, {
headers: {
'Authorization': `Bearer ${token}`, // 假设使用 Bearer token
'Content-Type': 'application/json' // 通常也需要指定内容类型