Add graphic captcha before user SMS login

This commit is contained in:
2026-07-09 12:09:10 +08:00
parent 0e2706a4f4
commit 34d6dd01c7
10 changed files with 234 additions and 13 deletions

View File

@@ -9,6 +9,8 @@ from app.schemas.user import UserProfile
class SendSmsRequest(BaseModel):
phone: str = Field(min_length=11, max_length=20)
captchaId: str = Field(min_length=1, max_length=100)
captchaCode: str = Field(min_length=4, max_length=8)
class LoginRequest(BaseModel):
@@ -20,3 +22,9 @@ class LoginResponse(BaseModel):
token: str
expiredAt: datetime
user: UserProfile
class CaptchaResponse(BaseModel):
captchaId: str
imageBase64: str
expiresInSeconds: int