refactor(api-logging):暂时删除权限校验与日志记录

This commit is contained in:
zhengxinonly
2021-09-16 02:46:48 +08:00
parent 316ebc2441
commit 3fa8ae0a8a
17 changed files with 80 additions and 101 deletions
-21
View File
@@ -59,24 +59,3 @@ def permission_required(permission: str) -> t.Callable:
return wrapper
return decorator
def authorize(power: str, log: bool = False):
def decorator(func):
@login_required
@wraps(func)
def wrapper(*args, **kwargs):
if power not in session.get('permissions'):
if log:
record_logging()
if request.method == 'GET':
abort(403)
else:
return jsonify(success=False, msg="权限不足!")
if log:
record_logging()
return func(*args, **kwargs)
return wrapper
return decorator