登录关闭验证码验证

This commit is contained in:
haotian 2025-07-28 10:43:15 +08:00
parent 580fd8f16b
commit 806006a218

View File

@ -26,12 +26,15 @@ async def login(
request: Request, form_data: CustomOAuth2PasswordRequestForm = Depends(), query_db: AsyncSession = Depends(get_db)
):
# 是否启用验证码
captcha_enabled = (
True
if await request.app.state.redis.get(f'{RedisInitKeyConfig.SYS_CONFIG.key}:sys.account.captchaEnabled')
== 'true'
else False
)
# captcha_enabled = (
# True
# if await request.app.state.redis.get(f'{RedisInitKeyConfig.SYS_CONFIG.key}:sys.account.captchaEnabled')
# == 'true'
# else False
# )
captcha_enabled =False
user = UserLogin(
userName=form_data.username,
password=form_data.password,