功能变化:

优化登录验证码
pull/49/head
猿小天 2022-04-15 19:07:55 +08:00
parent f0b41d28e6
commit c8602c59c5
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ class LoginSerializer(TokenObtainPairSerializer):
}
def validate(self, attrs):
captcha = getattr(attrs,'captcha',None)
captcha = self.initial_data.get('captcha',None)
if settings.CAPTCHA_STATE:
if captcha is None:
raise CustomValidationError("验证码不能为空")