调换序列化顺序

This commit is contained in:
zqm
2026-04-07 17:22:49 +08:00
parent faa0b3cb5e
commit a61f65b905
2 changed files with 21 additions and 1 deletions

View File

@@ -637,7 +637,7 @@ impl WebSocketClient {
/// Send a text message
pub async fn send(&self, msg_type: &str, data: Value) -> Result<(), WebSocketError> {
let message = WebSocketMessage::new(msg_type, data);
let json = serde_json::to_string(&message)?;
let json = message.to_json_string()?;
self.send_raw_text(json).await
}