fix(web): use runtime origin for public api calls
This commit is contained in:
@@ -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 ''
|
||||
|
||||
Reference in New Issue
Block a user