修复登录次数没有保存问题 update backend/dvadmin/system/views/login.py.

修复登录次数没有保存问题

Signed-off-by: lxy <46486798@qq.com>
This commit is contained in:
lxy
2024-07-29 03:19:29 +00:00
committed by Gitee
parent c8e235bed6
commit 3979628281

View File

@@ -124,6 +124,7 @@ class LoginSerializer(TokenObtainPairSerializer):
user.is_active = False user.is_active = False
user.save() user.save()
raise CustomValidationError("账号已被锁定,联系管理员解锁") raise CustomValidationError("账号已被锁定,联系管理员解锁")
user.save()
count = 5 - user.login_error_count count = 5 - user.login_error_count
raise CustomValidationError(f"账号/密码错误;重试{count}次后将被锁定~") raise CustomValidationError(f"账号/密码错误;重试{count}次后将被锁定~")