klover2 / nest-wechatpay-node-v3-ts

nest 版 微信v3支付
MIT License
33 stars 6 forks source link

WECHAT_PAY_MANAGER 无法使用 #2

Closed leelii closed 4 months ago

leelii commented 1 year ago

nest框架,在servive中下面这行会报错 constructor(@Inject(WECHAT_PAY_MANAGER) private wxPay: WxPay) {}

报错信息如下: Error: Nest can't resolve dependencies of the WeiXinService (?). Please make sure that the argument WECHAT_PAY_MANAGER at index [0] is available in the WeiXinModule context

klover2 commented 1 year ago

image 是否导入了这个module

wulianyougithub commented 1 year ago

同样的问题,已经在appModule中导入了,和文档中描述的一样,这个问题是怎么解决的

klover2 commented 1 year ago

同样的问题,已经在appModule中导入了,和文档中描述的一样,这个问题是怎么解决的

我这个是列子 正常使用你应该放在你自己的子module 里面

Groupguanfang commented 6 months ago

作者其实应该加一个global: boolean的配置,这样当我们指定global: true的时候,就可以全局使用这个模块了。

nest.js的DynamicModule是有这个的,只是作者没有把这个选项透传出来好像

@klover2 看看能不能把这个加上?

klover2 commented 6 months ago

global: true的时

已经支持 请使用 1.0.2

Groupguanfang commented 5 months ago

global: true的时

已经支持 请使用 1.0.2

Wow,nice