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'])