From 916f119d50b2c73d949c5b00f1493d41ecbf53a9 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Wed, 16 Aug 2023 16:07:36 +0800 Subject: [PATCH] fix: user info api bug --- app/api/v1/schema/user.py | 3 +-- app/api/v1/user.py | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/api/v1/schema/user.py b/app/api/v1/schema/user.py index 42dc4ca..385e46d 100644 --- a/app/api/v1/schema/user.py +++ b/app/api/v1/schema/user.py @@ -1,10 +1,9 @@ from apiflask import Schema -from apiflask.fields import String, URL, Float +from apiflask.fields import String, Float class UserInfoIn(Schema): nickname = String() - avatar_id = String() height = Float() diff --git a/app/api/v1/user.py b/app/api/v1/user.py index 19ea349..57d1767 100644 --- a/app/api/v1/user.py +++ b/app/api/v1/user.py @@ -13,11 +13,10 @@ user = APIBlueprint('user', __name__) @user.doc(summary='设置用户信息', description='设置用户信息') @user.input(UserInfoIn, location='json') @login_required -def wechat_login(json_data): +def set_user_info(json_data): try: rpc.admin.set_user_info(session['user_id'], - json_data.get('nickname', None), - json_data.get('avatar_id', None)) + json_data.get('nickname', None)) except Exception as e: raise UserInfoError(extra_data={'error_docs': str(e)}) @@ -34,7 +33,7 @@ def wechat_login(json_data): @user.doc(summary='查询用户信息', description='查询用户信息') @user.output(UserInfoOut) @login_required -def refresh_token(): +def get_user_info(): result = {} try: user_dict = rpc.admin.get_user_info(session['user_id'])