fix(trading,auth): add parent .env path for shared JWT_SECRET

Both services need to read JWT_SECRET from the shared .env file
in the parent directory (backend/services/.env).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-15 06:57:57 -08:00
parent 4440f40fba
commit 0420b0acab
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { InfrastructureModule } from './infrastructure/infrastructure.module';
// 配置模块
ConfigModule.forRoot({
isGlobal: true,
envFilePath: ['.env.local', '.env'],
envFilePath: ['.env.local', '.env', '../.env'],
}),
// 限流模块

View File

@ -13,7 +13,11 @@ import { JwtAuthGuard } from './shared/guards/jwt-auth.guard';
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: [`.env.${process.env.NODE_ENV || 'development'}`, '.env'],
envFilePath: [
`.env.${process.env.NODE_ENV || 'development'}`,
'.env',
'../.env', // 父目录共享 .env
],
ignoreEnvFile: false,
}),
InfrastructureModule,