@wendongfly/myhi 1.3.74 → 1.3.76

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.
package/dist/chat.html CHANGED
@@ -3292,11 +3292,15 @@
3292
3292
  try {
3293
3293
  const fd = new FormData();
3294
3294
  fd.append('audio', file, file.name);
3295
- const resp = await fetch('/api/voice-transcribe', { method: 'POST', body: fd });
3295
+ const resp = await fetch(`/api/voice-transcribe?sessionId=${SESSION_ID}`, { method: 'POST', body: fd });
3296
3296
  if (resp.status === 503) {
3297
3297
  _vaSetStatus('ASR 服务未配置,请在设置中填写语音识别地址', '#f85149');
3298
3298
  return;
3299
3299
  }
3300
+ if (!resp.ok && resp.headers.get('content-type')?.includes('text/html')) {
3301
+ _vaSetStatus('认证失败,请刷新页面重新登录', '#f85149');
3302
+ return;
3303
+ }
3300
3304
  const data = await resp.json();
3301
3305
  if (data.text?.trim()) {
3302
3306
  _vaLines.push(data.text.trim());