| 1234567891011121314151617181920212223 |
- import { Module } from '@nestjs/common';
- import { RedisCache, WeChatModule } from 'nest-wechat';
- import { ConfigModule, ConfigService } from '@nestjs/config';
- @Module({
- imports: [
- WeChatModule.forRootAsync({
- imports: [ConfigModule],
- inject: [ConfigService],
- useFactory: (configService: ConfigService, cache: Cache) => ({
- appId: configService.get('WX_APPID'),
- secret: configService.get('WX_SECRET'),
- token: configService.get('WX_TOKEN'),
- encodingAESKey: configService.get('WX_AESKEY'),
- cacheAdapter: new RedisCache(cache),
- debug: true,
- }),
- }),
- ],
- controllers: [],
- providers: [],
- })
- export class MiniProgramModule {}
|