File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class AuthSchemaBase(SchemaBase):
2020class AuthLoginParam (AuthSchemaBase ):
2121 """用户登录参数"""
2222
23- captcha_uuid : str | None = Field (None , description = '验证码 UUID' )
23+ uuid : str | None = Field (None , description = '验证码 UUID' )
2424 captcha : str | None = Field (None , description = '验证码' )
2525
2626
Original file line number Diff line number Diff line change @@ -103,14 +103,14 @@ async def login(
103103
104104 await load_login_config (db )
105105 if settings .LOGIN_CAPTCHA_ENABLED :
106- if not obj .captcha_uuid or not obj .captcha :
106+ if not obj .uuid or not obj .captcha :
107107 raise errors .RequestError (msg = t ('error.captcha.invalid' ))
108- captcha_code = await redis_client .get (f'{ settings .LOGIN_CAPTCHA_REDIS_PREFIX } :{ obj .captcha_uuid } ' )
108+ captcha_code = await redis_client .get (f'{ settings .LOGIN_CAPTCHA_REDIS_PREFIX } :{ obj .uuid } ' )
109109 if not captcha_code :
110110 raise errors .RequestError (msg = t ('error.captcha.expired' ))
111111 if captcha_code .lower () != obj .captcha .lower ():
112112 raise errors .CustomError (error = CustomErrorCode .CAPTCHA_ERROR )
113- await redis_client .delete (f'{ settings .LOGIN_CAPTCHA_REDIS_PREFIX } :{ obj .captcha_uuid } ' )
113+ await redis_client .delete (f'{ settings .LOGIN_CAPTCHA_REDIS_PREFIX } :{ obj .uuid } ' )
114114
115115 await user_dao .update_login_time (db , obj .username )
116116 await db .refresh (user )
You can’t perform that action at this time.
0 commit comments