From ed19109e80a10fd4def53bae13a59f8a917c8fa1 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 28 九月 2022 16:49:21 +0800 Subject: [PATCH] 导入更新用户数据前校验数据权限 --- src/main/java/com/ruoyi/project/common/CaptchaController.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ruoyi/project/common/CaptchaController.java b/src/main/java/com/ruoyi/project/common/CaptchaController.java index fecf890..13dd70f 100644 --- a/src/main/java/com/ruoyi/project/common/CaptchaController.java +++ b/src/main/java/com/ruoyi/project/common/CaptchaController.java @@ -12,9 +12,10 @@ 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; @@ -50,16 +51,16 @@ public AjaxResult getCode(HttpServletResponse response) throws IOException { AjaxResult ajax = AjaxResult.success(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); - ajax.put("captchaOnOff", captchaOnOff); - if (!captchaOnOff) + 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; -- Gitblit v1.9.3