对接微信支付

This commit is contained in:
2026-07-01 22:41:49 +08:00
parent b78ef8798c
commit ff4622ff6c
14 changed files with 389 additions and 19 deletions
@@ -31,7 +31,10 @@ import type { IOssProvider } from './oss/oss.interface';
provide: WECHAT_PROVIDER,
useFactory: (api: WechatApiProvider, disabled: WechatDisabledProvider): IWechatProvider => {
const cfg = loadAppConfig();
return cfg.wechatAuthEnabled && cfg.wxAppId ? api : disabled;
const enabled =
(cfg.wechatAuthEnabled || cfg.wechatPayEnabled) &&
(!!cfg.wxAppId || !!process.env.WX_MCH_ID);
return enabled ? api : disabled;
},
inject: [WechatApiProvider, WechatDisabledProvider],
},