SpringSunYY 5 месяцев назад
Родитель
Сommit
19473fed45
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 0
      ruoyi_admin/controller/index/captcha.py
  2. 1 1
      ruoyi_system/service/sys_config.py

+ 2 - 0
ruoyi_admin/controller/index/captcha.py

@@ -11,6 +11,7 @@ from ruoyi_common.base.model import AjaxResponse
 from ruoyi_common.constant import Constants
 from ruoyi_common.descriptor.serializer import JsonSerializer
 from ruoyi_admin.ext import redis_cache
+from ruoyi_system.service import SysConfigService
 from ... import reg
 
 
@@ -48,4 +49,5 @@ def index_captcha_image():
     ajax_response = AjaxResponse.from_success()
     ajax_response.uuid = uuid_str
     ajax_response.img = str(base64.b64encode(byte_image),encoding="utf-8")
+    ajax_response.captchaOnOff = SysConfigService.select_captcha_on_off()
     return ajax_response

+ 1 - 1
ruoyi_system/service/sys_config.py

@@ -69,7 +69,7 @@ class SysConfigService:
             bool: 验证码开关
         """
         captcha_on_off = cls.select_config_by_key("sys.account.captchaOnOff")
-        if captcha_on_off is not None and captcha_on_off.lower() != "false":
+        if captcha_on_off is None:
             return True
         return StringUtil.to_bool(captcha_on_off)