From 12696f35f8d0d44bee643863477c004d65bd3a2b Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 9 Sep 2026 13:21:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=8B=E9=9A=86=E9=9F=B3=E8=89=B2?= =?UTF-8?q?=E8=AF=95=E5=90=AC=E9=9F=B3=E9=A2=91=20URL=20HTTP=E2=86=92HTTPS?= =?UTF-8?q?=20=E5=85=BC=E5=AE=B9=EF=BC=88Mixed=20Content=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端 /tts/preview 返回 dashscope OSS HTTP URL, staging HTTPS 页面因 Mixed Content 阻止加载。 OSS 同时支持 HTTPS,前端临时替换协议。 后端应改用 sign_url 返回 HTTPS(已通知后端修复)。 --- apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx index aaedabc11..3cb97c148 100644 --- a/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx +++ b/apps/web/src/pages/ai-avatar/components/PanelVoiceSelector.tsx @@ -92,6 +92,9 @@ export function PanelVoiceSelector({ /** 用指定 URL 真实播放(抽取公共) */ const playAudioUrl = (voiceId: string, url: string) => { + // 临时兼容:后端 /tts/preview 返回 HTTP URL,staging 是 HTTPS,Mixed Content 会阻止加载 + // OSS 同时支持 HTTP/HTTPS,直接替换协议即可 + const safeUrl = url.startsWith("http://") ? url.replace("http://", "https://") : url if (audioRef.current) { audioRef.current.pause() audioRef.current = null