This commit is contained in:
fengchuanhn@gmail.com
2026-05-17 12:54:13 +08:00
parent 1b8ca10ec9
commit 3db327d93b
38 changed files with 2820 additions and 14 deletions

View File

@@ -30,7 +30,12 @@ async def register_user(
if existing is not None:
raise AuthError("用户名已存在")
user = User(username=username, password_hash=hash_password(password))
user = User(
username=username,
password_hash=hash_password(password),
role_id=0,
phone=None,
)
db.add(user)
await db.flush()
await db.refresh(user)