fix(ssr): avoid accessing window in EventBusDriver constructor during SSR
Build and Deploy / Build and Push Docker Image (push) Successful in 1m53s

- Add window check in EventBusDriver constructor
- Fix original-api.ts localStorage access
- Prevent SSR hydration errors
This commit is contained in:
2026-08-08 03:23:13 +08:00
parent 455f46caa0
commit 901de3e340
2 changed files with 13 additions and 2 deletions
+3
View File
@@ -21,6 +21,9 @@ class EventBusDriver {
private initialized = false
constructor() {
// 延迟初始化,避免 SSR 时访问 window
if (typeof window === 'undefined') return
const baseUrl = (window as any).__BASE_URL__ || ''
const apiVersion = (window as any).__API_VERSION__ || '/api/v1'
let host = window.location.host