From cf91734db586ac952f2bc04ab6d2ace73fcd0fd7 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 17 Sep 2025 10:26:43 +0800 Subject: [PATCH] refactor: adjust max_attempts default and captcha requirement in authentication logic --- apps/users/serializers/login.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/serializers/login.py b/apps/users/serializers/login.py index 9381f289c..675948dfc 100644 --- a/apps/users/serializers/login.py +++ b/apps/users/serializers/login.py @@ -76,12 +76,12 @@ class LoginSerializer(serializers.Serializer): except Exception: auth_setting = {} - max_attempts = auth_setting.get("max_attempts", 0) + max_attempts = auth_setting.get("max_attempts", 1) password = instance.get("password") captcha = instance.get("captcha", "") # 判断是否需要验证码 - need_captcha = True + need_captcha = False if max_attempts == -1: need_captcha = False elif max_attempts > 0: