This commit is contained in:
aaron 2025-04-15 11:21:00 +08:00
parent 210f0643df
commit b62b4dfb2e
2 changed files with 2 additions and 3 deletions

View File

@ -18,8 +18,6 @@ class UserCreate(UserBase):
class UserUpdate(UserBase):
"""更新用户请求模型"""
openid: Optional[str] = None
unionid: Optional[str] = None
avatar: Optional[str] = None
nickname: Optional[str] = None

View File

@ -48,6 +48,7 @@ async def update_user(db: AsyncSession, user_id: int, user_update: UserUpdate):
# 更新用户数据
for key, value in update_data.items():
if value is not None:
setattr(db_user, key, value)
await db.commit()