fix(auth): OnModuleInit改为warn而非throw,避免生产缺APPLE_BUNDLE_ID时进程崩溃
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
This commit is contained in:
parent
5fcfc87f84
commit
c6fd1731d5
@ -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 登录已配置,使用真实验签');
|
||||
}
|
||||
} else {
|
||||
if (this.appleBundleId) {
|
||||
this.logger.log('Apple 登录使用真实验签模式(已配置 bundleId)');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user