fix: 修复未绑定设备时状态处理

This commit is contained in:
lww155
2026-01-20 17:39:06 +08:00
parent 83304c9ff4
commit 95b340a7a3
2 changed files with 16 additions and 2 deletions
@@ -17,6 +17,7 @@ export class WebSocketHandler {
this.onChatMessage = null; // 新增:聊天消息回调
this.currentSessionId = null;
this.isRemoteSpeaking = false;
this.isEstablishConnection = false; // 新增:是否已建立连接
}
// 发送hello握手消息
@@ -73,6 +74,7 @@ export class WebSocketHandler {
handleTextMessage(message) {
if (message.type === 'hello') {
log(`服务器回应:${JSON.stringify(message, null, 2)}`, 'success');
this.isEstablishConnection = true;
} else if (message.type === 'tts') {
this.handleTTSMessage(message);
} else if (message.type === 'audio') {