From 77b983759956322fcd2259de4f1094217535dcdb Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期四, 13 二月 2025 17:59:08 +0800
Subject: [PATCH] 登录问题优化

---
 app/api/user.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/app/api/user.py b/app/api/user.py
index 57171ff..52d1e0f 100644
--- a/app/api/user.py
+++ b/app/api/user.py
@@ -23,6 +23,8 @@
 async def add_user(user: UserInfo, current_user: UserModel = Depends(get_current_user), db=Depends(get_db)):
     if not user.userName:
         return Response(code=400, msg="The userName cannot be empty!")
+    if "@" in user.username:
+        return Response(code=400, msg="Username cannot contain @")
     if user.pwd:
         if not is_valid_password(user.pwd):
             return Response(code=400, msg="The password must be at least 8 and contain both numbers and letters")

--
Gitblit v1.8.0