update
This commit is contained in:
parent
3fa45a738f
commit
7972638e80
@ -121,7 +121,6 @@ async def get_user_info(
|
||||
):
|
||||
"""获取用户信息"""
|
||||
|
||||
|
||||
# 获取用户默认地址
|
||||
default_address = db.query(AddressDB, CommunityDB.name.label('community_name')).join(
|
||||
CommunityDB,
|
||||
@ -134,6 +133,11 @@ async def get_user_info(
|
||||
# 构建返回数据
|
||||
user_info = UserInfo.model_validate(current_user)
|
||||
user_data = user_info.model_dump()
|
||||
|
||||
# 获取用户归属小区信息
|
||||
if current_user.community_id:
|
||||
user_data['community_id'] = current_user.community_id
|
||||
user_data['community_name'] = db.query(CommunityDB.name).filter(CommunityDB.id == current_user.community_id).first().name
|
||||
|
||||
# 处理默认地址
|
||||
if default_address:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user