Skip to content

Commit

Permalink
更新 user.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Jan 19, 2024
1 parent 16a4f61 commit 1f56cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/endpoints/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def update_user(
# 正则表达式匹配密码包含大写字母、小写字母、数字
pattern = r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]+$'
if not re.match(pattern, user_info.get("password")):
return schemas.Response(success=False, message="密码需包含大写小写数字")
return schemas.Response(success=False, message="密码需要同时包含大小写和数字")
user_info["hashed_password"] = get_password_hash(user_info["password"])
user_info.pop("password")
user = User.get_by_name(db, name=user_info["name"])
Expand Down

0 comments on commit 1f56cea

Please sign in to comment.