Skip to content

Commit a05bd36

Browse files
committed
升级依赖
1 parent 64f73b5 commit a05bd36

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backend/app/api/v1/v1_user.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# -*- coding: utf-8 -*-
33
import datetime
44
import os
5-
import re
65
from hashlib import sha256
76

87
import aiofiles
98
from email_validator import EmailNotValidError, validate_email
10-
from fast_captcha import tCaptcha
9+
from fast_captcha import text_captcha
1110
from fastapi import APIRouter, Depends, File, HTTPException, Request, Response, status, UploadFile, BackgroundTasks
1211
from fastapi.security import OAuth2PasswordRequestForm
1312
from fastapi_pagination.ext.async_sqlalchemy import paginate
@@ -107,7 +106,7 @@ async def get_email_login_code(request: Request, email: ELCode, tasks: Backgroun
107106
if not current_user.is_active:
108107
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail='该用户已被锁定,无法登录,发送验证码失败', headers=headers)
109108
try:
110-
code = tCaptcha()
109+
code = text_captcha()
111110
tasks.add_task(send_email_verification_code, email.email, code, SEND_EMAIL_LOGIN_TEXT)
112111
except Exception as e:
113112
log.exception('验证码发送失败 {}', e)
@@ -185,7 +184,7 @@ async def user_register(create: CreateUser, db: AsyncSession = Depends(get_db)):
185184
@user.post('/password_reset_code', summary='获取密码重置验证码', description='可以通过用户名或者邮箱重置密码')
186185
async def password_reset_code(username_or_email: str, response: Response, tasks: BackgroundTasks,
187186
db: AsyncSession = Depends(get_db)):
188-
code = tCaptcha()
187+
code = text_captcha()
189188
if await user_crud.get_user_by_username(db, username_or_email):
190189
try:
191190
response.delete_cookie(key='fast-code')

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ path==15.1.2
1212
starlette==0.14.2
1313
Faker==9.7.1
1414
python-jose==3.3.0
15-
fast-captcha==0.1.2
15+
fast-captcha==0.1.3
1616
fastapi-pagination==0.9.1
1717
aiofiles==0.8.0

0 commit comments

Comments
 (0)