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