feat: wechat module
This commit is contained in:
1 parent
bbf5360ef7
commit
966f60d483
3 files changed
+86
No files matched your search
@@ -0,0 +1,23 @@
|
||||
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 {}
|
||||
Reference in new issue
Block a user