Ready to update to v2.5

Please wait for some time. I need to change readme. I almost forgot what I changed before.
WARNING: There will be many bugs!
This commit is contained in:
Lost-MSth
2021-06-10 19:01:26 +08:00
parent 8a3cec05b7
commit 3fbf473de2
27 changed files with 1690 additions and 662 deletions

View File

@@ -89,11 +89,10 @@ def role_required(request, power=[]):
return jsonify({'status': 401, 'code': -1, 'data': {}, 'msg': 'No Token'})
user = User()
if power == []:
if Config.API_TOKEN == request.headers['Token'] and Config.API_TOKEN != '':
user.user_id = 0
else:
return jsonify({'status': 403, 'code': -1, 'data': {}, 'msg': 'No permission'})
if Config.API_TOKEN == request.headers['Token'] and Config.API_TOKEN != '':
user.user_id = 0
elif power == []:
return jsonify({'status': 403, 'code': -1, 'data': {}, 'msg': 'No permission'})
else:
with Connect() as c:
user.user_id = api_token_get_id(