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
-17
View File
@@ -1,17 +0,0 @@
#
MYSQL_HOST = '127.0.0.1'
MYSQL_PORT = '3306'
MYSQL_DATABASE = 'PearAdminFlask'
MYSQL_USERNAME = 'root'
MYSQL_PASSWORD = 'root'
MYSQL_DB_URI = "mysql+pymysql://{username}:{password}@{host}:{port}/{db}?charset=utf8".format(username=USERNAME,
password=PASSWORD,
host=HOST,
port=PORT,
db=DATABASE)
SQLALCHEMY_DATABASE_URI = MYSQL_DB_URI
SQLALCHEMY_TRACK_MODIFICATIONS = True
SQLALCHEMY_ECHO = False
SQLALCHEMY_POOL_RECYCLE = 8
-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