Archived
修改文件结构
This commit is contained in:
9 files changed
+105
-75
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
# -- coding:utf-8 --
|
||||
# @Author: markushammered@gmail.com
|
||||
# @Development Tool: PyCharm
|
||||
# @Create Time: 2022/4/11
|
||||
# @File Name: decorators.py
|
||||
|
||||
|
||||
import os
|
||||
from flask import request
|
||||
from flask import abort
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def permission_required(func):
|
||||
@wraps(func)
|
||||
def decorated_func(*args, **kwargs):
|
||||
if request.args.get('key') != os.getenv('ACCESS_KEY'):
|
||||
abort(403)
|
||||
return func(*args, **kwargs)
|
||||
|
||||
return decorated_func
|
||||
|
||||
Reference in New Issue
Block a user