From 8e39f175ef26827d08904a65b10748e736eeca21 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 23 六月 2025 10:20:08 +0800
Subject: [PATCH] 2025-06-23 【销售台账】   增加客户合同号、销售合同号、项目名称模糊查询 增加客户名称、客户合同号、项目名称查询,不显示待回款为0,默认为打钩。 销售管理】-【回款流水】,增加合同号、项目名称列查询,增加客户名称、项目名称、合同号查询条件。 【销售管理】-【回款登记】,增加导出功能

---
 src/main/java/com/ruoyi/project/common/CaptchaController.java |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/project/common/CaptchaController.java b/src/main/java/com/ruoyi/project/common/CaptchaController.java
index 1e4933b..13dd70f 100644
--- a/src/main/java/com/ruoyi/project/common/CaptchaController.java
+++ b/src/main/java/com/ruoyi/project/common/CaptchaController.java
@@ -12,11 +12,13 @@
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 import com.google.code.kaptcha.Producer;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.utils.IdUtils;
 import com.ruoyi.common.utils.sign.Base64;
+import com.ruoyi.common.utils.uuid.IdUtils;
 import com.ruoyi.framework.redis.RedisCache;
 import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.project.system.service.ISysConfigService;
 
 /**
  * 楠岃瘉鐮佹搷浣滃鐞�
@@ -38,6 +40,9 @@
     // 楠岃瘉鐮佺被鍨�
     @Value("${ruoyi.captchaType}")
     private String captchaType;
+    
+    @Autowired
+    private ISysConfigService configService;
 
     /**
      * 鐢熸垚楠岃瘉鐮�
@@ -45,9 +50,17 @@
     @GetMapping("/captchaImage")
     public AjaxResult getCode(HttpServletResponse response) throws IOException
     {
+        AjaxResult ajax = AjaxResult.success();
+        boolean captchaEnabled = configService.selectCaptchaEnabled();
+        ajax.put("captchaEnabled", captchaEnabled);
+        if (!captchaEnabled)
+        {
+            return ajax;
+        }
+
         // 淇濆瓨楠岃瘉鐮佷俊鎭�
         String uuid = IdUtils.simpleUUID();
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
 
         String capStr = null, code = null;
         BufferedImage image = null;
@@ -78,7 +91,6 @@
             return AjaxResult.error(e.getMessage());
         }
 
-        AjaxResult ajax = AjaxResult.success();
         ajax.put("uuid", uuid);
         ajax.put("img", Base64.encode(os.toByteArray()));
         return ajax;

--
Gitblit v1.9.3