whycxzp
2023-10-16 b01970f44d757b22aca2e5ca3fbb9041b0d3a93e
登录验证码开关
4个文件已修改
26 ■■■■ 已修改文件
src/main/java/com/whyc/constant/YamlProperties.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/LoginService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/application-dev.yml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/config/application-prod.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/constant/YamlProperties.java
@@ -45,6 +45,8 @@
    /**系统运行模式*/
    public static Integer runModel;
    public static String fontDynamicCodeSwitch;
    @Value("${spring.profiles.active}")
    public void setProfileType(String profileType) {
        YamlProperties.profileType = profileType;
@@ -130,6 +132,11 @@
        YamlProperties.faceType = faceType;
    }
    @Value("${custom.fontDynamicCode}")
    public void setFontDynamicCodeSwitch(String fontDynamicCodeSwitch) {
        YamlProperties.fontDynamicCodeSwitch = fontDynamicCodeSwitch;
    }
    @Value("${configFile.type}")
    public void setRunModel(Integer runModel) {
        YamlProperties.runModel = runModel;
src/main/java/com/whyc/service/LoginService.java
@@ -111,13 +111,15 @@
    public Response loginByRSA(String userName, String pwd,String deliveredCode, HttpServletRequest request) {
        Response<Object> response = new Response<>();
        deliveredCode = deliveredCode.toUpperCase();
        String fontDynamicCode = (String) ActionUtil.getSession().getAttribute("fontDynamicCode");
        /*if (fontDynamicCode == null || "".equals(fontDynamicCode)) {
            return response.set(1, false, MessageUtils.getMessage("RefreshVerification"));
        if(YamlProperties.fontDynamicCodeSwitch.toLowerCase().equals("on")) {
            String fontDynamicCode = (String) ActionUtil.getSession().getAttribute("fontDynamicCode");
            if (fontDynamicCode == null || "".equals(fontDynamicCode)) {
                return response.set(1, false, MessageUtils.getMessage("RefreshVerification"));
            }
            if (!deliveredCode.equals(fontDynamicCode.toUpperCase())) {
                return response.set(1, false, MessageUtils.getMessage("VerificationError"));
            }
        }
        if (!deliveredCode.equals(fontDynamicCode.toUpperCase())) {
            return response.set(1, false, MessageUtils.getMessage("VerificationError"));
        }*/
        //验证正确,清除验证码
        ActionUtil.getSession().removeAttribute("fontDynamicCode");
        String password = "";
src/main/resources/config/application-dev.yml
@@ -11,6 +11,7 @@
      timeout: -1
      cookie:
        name: fg_v2
        http-only: true
  tomcat:
    max-http-form-post-size: 102400000
http:
@@ -96,6 +97,8 @@
  #告警工单
  alarm:
    task.switch: off
  #登录验证码 on/off
  fontDynamicCode: on
#Config文件读取 涉及License和FGCDFileDownload
configFile:
src/main/resources/config/application-prod.yml
@@ -97,6 +97,8 @@
  #告警工单
  alarm:
    task.switch: off
  #登录验证码
  fontDynamicCode: on
#Config文件读取 涉及License和FGCDFileDownload
configFile: