feat: 实现演示验证码和令牌轮换

This commit is contained in:
root
2026-09-14 18:43:45 +08:00
parent 6b901e074e
commit 3e04197b02
24 changed files with 1486 additions and 12 deletions
+9
View File
@@ -2,12 +2,20 @@ import "reflect-metadata";
import { ValidationPipe, type INestApplication } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
import helmet from "helmet";
import type { Application } from "express";
import { AppModule } from "./app.module.js";
import { validateAuthEnvironment } from "./auth/auth.config.js";
import { HttpResponseInterceptor } from "./common/http-response.interceptor.js";
import { DomainExceptionFilter } from "./common/domain-exception.filter.js";
export function configureApp(app: INestApplication): void {
validateAuthEnvironment();
const allowedOrigin = process.env.WEB_ORIGIN ?? "http://localhost:3000";
const adapter = app.getHttpAdapter?.() as
{ getInstance(): Application } | undefined;
adapter
?.getInstance()
.set("trust proxy", process.env.TRUST_PROXY === "true" ? 1 : false);
app.setGlobalPrefix("api/v1");
app.use(helmet());
app.useGlobalPipes(
@@ -35,6 +43,7 @@ type AppFactory = () => Promise<INestApplication>;
export async function bootstrap(
appFactory: AppFactory = () => NestFactory.create(AppModule),
): Promise<void> {
validateAuthEnvironment();
const app = await appFactory();
configureApp(app);
app.enableShutdownHooks();