diff --git a/.env.example b/.env.example index 22dd975..3b8c533 100644 --- a/.env.example +++ b/.env.example @@ -35,7 +35,7 @@ AUTH_LOCK_MINUTES=15 # ---------- API ---------- PORT=3000 HOST=0.0.0.0 -WEB_ORIGIN=http://127.0.0.1:5173 +WEB_ORIGIN=http://127.0.0.1:5173,http://localhost:5173 MAX_UPLOAD_MB=500 # ---------- Worker ---------- diff --git a/apps/api/src/config/env.ts b/apps/api/src/config/env.ts index 7bb36d9..e8b22df 100644 --- a/apps/api/src/config/env.ts +++ b/apps/api/src/config/env.ts @@ -19,7 +19,7 @@ const envSchema = z.object({ (value) => value.startsWith('redis://') || value.startsWith('rediss://'), 'REDIS_URL 必须是 redis:// 连接串', ), - WEB_ORIGIN: z.string().default('http://127.0.0.1:5173'), + WEB_ORIGIN: z.string().default('http://127.0.0.1:5173,http://localhost:5173'), MAX_UPLOAD_MB: z.coerce.number().int().min(1).max(10240).default(500), FEATURE_VIDEO: z .enum(['true', 'false'])