fix(web): use runtime origin for public api calls
Some checks failed
CD Pipeline / build-and-deploy (push) Blocked by required conditions
CD Pipeline / tests (push) Successful in 1m41s
CD Pipeline / post-deploy-checks (push) Has been cancelled
Code Review / ai-code-review (push) Failing after 12m56s

This commit is contained in:
Your Name
2026-06-28 10:53:00 +08:00
parent be48d0187a
commit 46faf9cb6b
13 changed files with 41 additions and 14 deletions

View File

@@ -17,6 +17,7 @@
*/
import { useEffect, useRef, useCallback } from 'react'
import { getRuntimeApiBaseUrl } from '@/lib/runtime-api-base'
import { useDashboardStore } from '@/stores/dashboard.store'
// =============================================================================
@@ -54,7 +55,7 @@ const getApiBaseUrl = (): string => {
if (typeof window === 'undefined') return ''
// 專案鐵律: 禁止任何 Fallback IP
const url = process.env.NEXT_PUBLIC_API_URL
const url = getRuntimeApiBaseUrl()
if (!url) {
console.error('[AWOOOI ERROR] Missing NEXT_PUBLIC_API_URL. SSE will not connect.')
return ''