diff --git a/src/modules/auth/apple-auth.service.ts b/src/modules/auth/apple-auth.service.ts index 2afe221..25c6148 100644 --- a/src/modules/auth/apple-auth.service.ts +++ b/src/modules/auth/apple-auth.service.ts @@ -27,12 +27,14 @@ export class AppleAuthService implements OnModuleInit { const nodeEnv = process.env.NODE_ENV; if (nodeEnv === 'production') { if (!this.appleBundleId) { - throw new Error( - '生产环境必须设置 APPLE_BUNDLE_ID 环境变量。\n' + + this.logger.error( + '生产环境未配置 APPLE_BUNDLE_ID!Apple 登录将返回 401。\n' + '请在 .env 中添加: APPLE_BUNDLE_ID=com.your.bundle.id', ); + // 不抛异常 — 拒绝启动会阻断整个服务。运行时已保证 401 拒绝。 + } else { + this.logger.log('Apple 登录已配置,使用真实验签'); } - this.logger.log('Apple 登录已配置,使用真实验签'); } else { if (this.appleBundleId) { this.logger.log('Apple 登录使用真实验签模式(已配置 bundleId)');