XTvLi
2021-11-10 b00171366ff27099133675f8bd66464b5e037867
统一全局配置内容, 删除临时调用配置文件
已修改2个文件
18 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
@@ -6,8 +6,8 @@
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.config.RuoYiConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.FastByteArrayOutputStream;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -36,10 +36,6 @@
    @Autowired
    private RedisCache redisCache;
    
    // 验证码类型
    @Value("${ruoyi.captchaType}")
    private String captchaType;
    @Autowired
    private ISysConfigService configService;
    /**
@@ -64,6 +60,7 @@
        BufferedImage image = null;
        // 生成验证码
        String captchaType = RuoYiConfig.getCaptchaType();
        if ("math".equals(captchaType))
        {
            String capText = captchaProducerMath.createText();
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
@@ -30,6 +30,9 @@
    /** 获取地址开关 */
    private static boolean addressEnabled;
    /** 验证码类型 */
    private static String captchaType;
    public String getName()
    {
        return name;
@@ -90,6 +93,14 @@
        RuoYiConfig.addressEnabled = addressEnabled;
    }
    public static String getCaptchaType() {
        return captchaType;
    }
    public void setCaptchaType(String captchaType) {
        RuoYiConfig.captchaType = captchaType;
    }
    /**
     * 获取导入上传路径
     */