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

@@ -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)