diff --git a/src/payment/adapters/douyin-payment.adapter.ts b/src/payment/adapters/douyin-payment.adapter.ts index 23578e3..26b57a3 100644 --- a/src/payment/adapters/douyin-payment.adapter.ts +++ b/src/payment/adapters/douyin-payment.adapter.ts @@ -72,7 +72,7 @@ export class DouyinPaymentAdapter extends BasePaymentAdapter { this.notifyToken = this.configService.get('DOUYIN_NOTIFY_TOKEN') || ''; if (!this.appId || !this.appSecret || !this.merchantId) { - this.logger.error('抖音支付配置不完整,请检查环境变量配置'); + this.logger.warn('抖音支付配置不完整,相关功能将不可用。请配置环境变量: DOUYIN_MINIPROGRAM_APPID, DOUYIN_MINIPROGRAM_SECRET, DOUYIN_MERCHANT_ID'); } } diff --git a/src/payment/adapters/wechat-payment.adapter.ts b/src/payment/adapters/wechat-payment.adapter.ts index b358cac..b4510ae 100644 --- a/src/payment/adapters/wechat-payment.adapter.ts +++ b/src/payment/adapters/wechat-payment.adapter.ts @@ -74,7 +74,7 @@ export class WechatPaymentAdapter extends BasePaymentAdapter { this.serialNumber = this.configService.get('WECHAT_SERIAL_NUMBER') || ''; if (!this.appId || !this.mchId || !this.privateKey || !this.apiV3Key) { - this.logger.error('微信支付配置不完整,请检查环境变量配置'); + this.logger.warn('微信支付配置不完整,相关功能将不可用。请配置环境变量: WECHAT_MINIPROGRAM_APPID, WECHAT_MCH_ID, WECHAT_PRIVATE_KEY, WECHAT_API_V3_KEY'); } } diff --git a/src/payment/payment.module.ts b/src/payment/payment.module.ts index 4feeed0..0ea6846 100644 --- a/src/payment/payment.module.ts +++ b/src/payment/payment.module.ts @@ -4,6 +4,9 @@ import { HttpModule } from '@nestjs/axios'; import { JwtModule } from '@nestjs/jwt'; import { ConfigService } from '@nestjs/config'; +// 平台模块 +import { PlatformModule } from '../platform/platform.module'; + // 实体 import { PaymentOrderEntity } from './entities/payment-order.entity'; import { PaymentTransactionEntity } from './entities/payment-transaction.entity'; @@ -33,6 +36,9 @@ import { PaymentController } from './controllers'; */ @Module({ imports: [ + // 平台模块 (提供 PlatformAuthGuard 和相关服务) + PlatformModule, + // TypeORM 实体注册 TypeOrmModule.forFeature([ // 支付相关实体 diff --git a/src/platform/platform.module.ts b/src/platform/platform.module.ts index be948f2..e7753a2 100644 --- a/src/platform/platform.module.ts +++ b/src/platform/platform.module.ts @@ -70,6 +70,6 @@ import { PlatformAuthGuard } from './guards/platform-auth.guard'; }, ], controllers: [UnifiedUserController], - exports: [UnifiedUserService, PlatformAdapterFactory], + exports: [UnifiedUserService, PlatformAdapterFactory, PlatformAuthGuard], }) export class PlatformModule {}