react_hsbc_teller 2.0.47 → 2.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,6 +68,9 @@ export default class MyAsrController {
68
68
  onConnectError(data) {
69
69
  console.log('连接错误');
70
70
  }
71
+ onAsrError(data) {
72
+ console.log('服务端返回错误');
73
+ }
71
74
 
72
75
  initWebSocket() {
73
76
  console.log("初始化weosocket");
@@ -196,6 +199,16 @@ export default class MyAsrController {
196
199
  } else if ( ret.header.name === 'TranscriptionCompleted') {
197
200
  console.log('服务端已停止了语音转写', ret);
198
201
  }
202
+
203
+ if (ret.header.status != 20000000) {
204
+ this.onAsrError({
205
+ status: ret.header.status,
206
+ message: ret.header.status_text,
207
+ taskId: ret.header.task_id,
208
+ });
209
+ } else {
210
+ // console.log('status返回正常')
211
+ }
199
212
  }
200
213
 
201
214
  websocketSend(Data) { // 数据发送