[Enhance][Refactor] unranked score & warning log

- Add an option that can be used to forbid some illegal scores
- Add brief warning logs for custom exceptions
This commit is contained in:
Lost-MSth
2022-11-28 21:58:06 +08:00
parent a7a9a4ba3d
commit 426f65ea9e
9 changed files with 84 additions and 66 deletions

View File

@@ -5,7 +5,7 @@ from core.config_manager import Config
from core.error import ArcError, NoAccess
from core.sql import Connect
from core.user import UserAuth, UserLogin
from flask import Blueprint, jsonify, request
from flask import Blueprint, g, jsonify, request
from .func import arc_try, error_return
@@ -55,6 +55,7 @@ def auth_required(request):
user = UserAuth(c)
user.token = headers['Authorization'][7:]
user_id = user.token_get_id()
g.user = user
except ArcError as e:
return error_return(e)
return view(user_id, *args, **kwargs)