Pu Zhibing
2025-04-01 8444084e6aa11efa23287e7f82474ac22378a5c4
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/config/WxCpConfiguration.java
@@ -27,9 +27,8 @@
    private WxCpProperties properties;
    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnMissingBean(name = "wxService")
    public WxCpService wxService() {
        WxCpDefaultConfigImpl wxCpConfigStorage = new WxCpDefaultConfigImpl();
        wxCpConfigStorage.setCorpId(properties.getCorpId());
        wxCpConfigStorage.setAgentId(properties.getAgentId());
@@ -41,6 +40,20 @@
        return wxService;
    }
    @Bean
    @ConditionalOnMissingBean(name = "adWxService")
    public WxCpService adWxService() {
        WxCpDefaultConfigImpl wxAdCpConfigStorage = new WxCpDefaultConfigImpl();
        wxAdCpConfigStorage.setCorpId(properties.getCorpId());
        wxAdCpConfigStorage.setAgentId(properties.getAgentId());
        wxAdCpConfigStorage.setCorpSecret(properties.getAddressSecret());
        wxAdCpConfigStorage.setAesKey(properties.getEncodingAESKey());
        wxAdCpConfigStorage.setToken(properties.getToken());
        WxCpService adWxService = new WxCpServiceImpl();
        adWxService.setWxCpConfigStorage(wxAdCpConfigStorage);
        return adWxService;
    }
    @Bean
    @ConditionalOnMissingBean