diff --git a/src/main.ts b/src/main.ts index f3218c1..0a2b886 100644 --- a/src/main.ts +++ b/src/main.ts @@ -46,7 +46,11 @@ async function bootstrap() { const configService = app.get(ConfigService); // 获取 ConfigService 实例 app.enableCors({ - origin: true, // 允许所有来源 + origin: [ + 'https://tradingadvfrontend.vercel.app', + 'http://localhost:8000', + 'http://localhost:3030', + ], // 明确指定允许的前端域名 credentials: true, // 允许携带凭证 methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'], // 明确指定允许的 HTTP 方法 allowedHeaders: [