From f7f54d3a956fa27f7bb3ce66e2c49091c5db5b9d Mon Sep 17 00:00:00 2001 From: cc <94575594@qq.com> Date: Tue, 24 Mar 2026 11:59:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(speaking):=20=E6=A0=B9=E6=8D=AE=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8A=A8=E6=80=81=E9=80=89=E6=8B=A9=20WebSocket=20?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Speaking.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/Speaking.vue b/src/views/Speaking.vue index 79c2b26..b70c65c 100644 --- a/src/views/Speaking.vue +++ b/src/views/Speaking.vue @@ -612,7 +612,8 @@ const startRecording = async () => { try { // 1. 通过 Vite 代理连接(代理层自动注入鉴权 Header,绕过浏览器 WS 不支持自定义 Header 的限制) - const wsUrl = `wss://${location.host}/asr-ws/api/v3/sauc/bigmodel`; + const wsProtocol = import.meta.env.DEV ? 'ws' : 'wss'; + const wsUrl = `${wsProtocol}://${location.host}/asr-ws/api/v3/sauc/bigmodel`; const ws = new WebSocket(wsUrl); ws.binaryType = "arraybuffer"; asrWs = ws;