引入接口频率限制机制
This commit is contained in:
@@ -6,6 +6,7 @@ from applications.common.utils.http import table_api, success_api, fail_api
|
||||
from applications.common.utils.rights import authorize
|
||||
from applications.common.utils.validate import str_escape
|
||||
from applications.extensions import db
|
||||
from applications.extensions.init_limit import limiter
|
||||
from applications.models import DictType, DictData
|
||||
from applications.schemas import DictTypeOutSchema, DictDataOutSchema
|
||||
|
||||
@@ -20,6 +21,7 @@ def main():
|
||||
|
||||
|
||||
@bp.get('/dictType/data')
|
||||
@limiter.limit("60 per minute")
|
||||
@authorize("system:dict:main")
|
||||
def dict_type_data():
|
||||
# 获取请求参数
|
||||
@@ -154,6 +156,7 @@ def dict_type_delete(_id):
|
||||
|
||||
|
||||
@bp.get('/dictData/data')
|
||||
@limiter.limit("60 per minute")
|
||||
@authorize("system:dict:main", log=True)
|
||||
def dict_code_data():
|
||||
type_code = str_escape(request.args.get('typeCode', type=str))
|
||||
|
||||
Reference in New Issue
Block a user