fix(web): use runtime origin for public api calls
This commit is contained in:
@@ -20,6 +20,7 @@ import { Sidebar } from './sidebar'
|
||||
import { Header } from './header'
|
||||
import { DotMatrixBg } from '@/components/ui/dot-matrix-bg'
|
||||
import { Z_INDEX } from '@/lib/constants/z-index'
|
||||
import { getRuntimeApiBaseUrl } from '@/lib/runtime-api-base'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { useDashboardStore } from '@/stores/dashboard.store'
|
||||
|
||||
@@ -92,7 +93,7 @@ export function AppLayout({
|
||||
|
||||
// Phase 19 修復: 全局啟動 SSE 連接 (所有頁面共享)
|
||||
useEffect(() => {
|
||||
const apiBaseUrl = process.env.NEXT_PUBLIC_API_URL || ''
|
||||
const apiBaseUrl = getRuntimeApiBaseUrl()
|
||||
if (apiBaseUrl) {
|
||||
console.log('[AppLayout] 全局 SSE 連接啟動...', apiBaseUrl)
|
||||
connect(apiBaseUrl)
|
||||
|
||||
Reference in New Issue
Block a user