diff --git a/backend/app/api/service/user_service.py b/backend/app/api/service/user_service.py index ca4dd92..5a19522 100644 --- a/backend/app/api/service/user_service.py +++ b/backend/app/api/service/user_service.py @@ -72,12 +72,12 @@ class UserService: await UserDao.reset_password(db, obj.id, obj.password2) @staticmethod - async def get_user_info(username: str): + async def get_userinfo(username: str): async with async_db_session() as db: user = await UserDao.get_user_by_username(db, username) if not user: raise errors.NotFoundError(msg='用户不存在') - return user + return user @staticmethod async def update(*, username: str, current_user: User, obj: UpdateUser): diff --git a/backend/app/api/v1/auth/user.py b/backend/app/api/v1/auth/user.py index d21ef97..a1c12c0 100644 --- a/backend/app/api/v1/auth/user.py +++ b/backend/app/api/v1/auth/user.py @@ -40,7 +40,7 @@ async def password_reset(obj: ResetPassword): @router.get('/{username}', summary='查看用户信息', dependencies=[DependsUser]) async def userinfo(username: str): - current_user = await UserService.get_user_info(username) + current_user = await UserService.get_userinfo(username) return response_base.response_200(data=current_user, exclude={'password'})