修正NEXT_PUBLIC的读取

This commit is contained in:
mtvpls
2025-12-17 21:24:44 +08:00
parent ece16b38ee
commit 6a12951753
5 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ type VoiceStrategy = 'webrtc-fallback' | 'server-only';
// 获取语音聊天策略配置
function getVoiceStrategy(): VoiceStrategy {
if (typeof window === 'undefined') return 'webrtc-fallback';
const strategy = process.env.NEXT_PUBLIC_VOICE_CHAT_STRATEGY || 'webrtc-fallback';
const strategy = (window as any).RUNTIME_CONFIG?.VOICE_CHAT_STRATEGY || 'webrtc-fallback';
return strategy as VoiceStrategy;
}