|
@@ -19,7 +19,7 @@ from fastapi.requests import Request
|
|
|
from fastapi.security import OAuth2PasswordRequestForm
|
|
|
|
|
|
import services.limiter as limiter
|
|
|
-from chaojiying import CJ
|
|
|
+from services.chaojiying import CJ
|
|
|
from services.defults import FAKE_USERS_DB
|
|
|
from services.limiter import LIMITER
|
|
|
from services.utils import calculate
|
|
@@ -27,7 +27,7 @@ from services.utils import calculate
|
|
|
images_router = APIRouter(prefix="/images")
|
|
|
|
|
|
|
|
|
-@images_router.post("/verify", summary="OCR")
|
|
|
+@images_router.post("/verify", summary="Ocr")
|
|
|
async def simple_captcha(file: UploadFile = File(...)):
|
|
|
start = time.time()
|
|
|
img_bytes = await file.read()
|
|
@@ -169,7 +169,7 @@ async def discern_complex_image(
|
|
|
cjy_captcha: dict = Depends(cjy_postpic_base64),
|
|
|
):
|
|
|
user_authentication(form_data)
|
|
|
- limiter.LM_COUNTER += 1
|
|
|
+ limiter.increase_usages_count()
|
|
|
limiter.limiter_warring()
|
|
|
return cjy_captcha
|
|
|
|