[Enhance] API user change

- Add a method of API to change the user's info
This commit is contained in:
Lost-MSth
2022-11-07 22:52:42 +08:00
parent 7cc17181e1
commit b70bfd6081
5 changed files with 122 additions and 21 deletions

View File

@@ -70,11 +70,11 @@ def request_json_handle(request, required_keys=[], optional_keys=[]):
json_data = loads(
b64decode(request.args['query']).decode())
else:
return view(data, *args, **kwargs)
json_data = {}
for key in required_keys:
if key not in json_data:
return error_return(PostError('Missing parameter: ' + key, api_error_code=-100))
return error_return(PostError(f'Missing parameter: {key}', api_error_code=-100))
data[key] = json_data[key]
for key in optional_keys: