From 90748f8108f1e916791da729a687e322e54dac3e Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Sun, 28 Sep 2025 01:57:32 +0000
Subject: [PATCH] 企微通信redis锁问题修改

---
 eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
index f6b2085..eb78f89 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
@@ -33,9 +33,17 @@
 //        // 默认缓存配置
 //        WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl();
 
-        // redis缓存配置
-        StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class);
-        WxCpDefaultConfigImpl configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix());
+        WxCpDefaultConfigImpl configStorage;
+        if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.redistemplate)) {
+            // redis缓存配置
+            StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class);
+            configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix());
+        } else {
+            // 默认配置
+            configStorage = new WxCpDefaultConfigImpl();
+        }
+
+        // 基本配置
         configStorage.setCorpId(wxCpProperties.getCorpId());
         configStorage.setAgentId(wxCpProperties.getAgentId());
         configStorage.setCorpSecret(wxCpProperties.getCorpSecret());

--
Gitblit v1.9.3