v2.9update

This commit is contained in:
2026-06-08 10:40:59 +08:00
parent 8d497d73d2
commit 70e7ad8e5e
20 changed files with 162 additions and 74 deletions

View File

@@ -93,6 +93,17 @@ class UserModel:
"""
await execute_update(sql, (ip, user_id))
@staticmethod
async def get_by_username_any(username: str) -> dict:
"""根据用户名获取用户(含已禁用)"""
sql = """
SELECT user_id, username, password_hash, real_name, user_type,
student_id, status, need_change_password, last_login_time, last_login_ip
FROM users
WHERE username = %s
"""
return await execute_one(sql, (username,))
@staticmethod
async def check_username_exists(username: str) -> bool:
"""检查用户名是否存在"""