From 87f053f38097f437ee541f51c38a8ac653f9c463 Mon Sep 17 00:00:00 2001 From: SZCJW <792430652@qq.com> Date: Wed, 4 Mar 2026 22:32:46 +0800 Subject: [PATCH] init --- requirements.txt | 1 + src/services/auth_service.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 8d35e54..f977894 100644 --- a/requirements.txt +++ b/requirements.txt @@ -38,6 +38,7 @@ jinja2 # JWT认证 python-jose[cryptography] passlib[bcrypt] +bcrypt # 邮箱验证 email-validator diff --git a/src/services/auth_service.py b/src/services/auth_service.py index 302ecf9..ba4847a 100644 --- a/src/services/auth_service.py +++ b/src/services/auth_service.py @@ -21,6 +21,8 @@ def verify_password(plain_password: str, hashed_password: str) -> bool: def get_password_hash(password: str) -> str: + if len(password.encode('utf-8')) > 72: + password = password[:72] return pwd_context.hash(password)