e570a364 by 冯轩

FIX:参数校验

1 parent 75e94e77
......@@ -97,6 +97,18 @@ employee_args = {
'business_type': fields.Str(required=True, validate=validate.Length(max=64)),
}
q_gb_file_args = {
'file_path': fields.Str(required=True, validate=validate.Length(max=255)),
'business_type': fields.Str(required=True, validate=validate.Length(max=64)),
}
d_gb_file_args = {
'object_id': fields.Str(required=True, validate=validate.Length(max=64)),
'save_path': fields.Str(required=True, validate=validate.Length(max=255)),
'business_type': fields.Str(required=True, validate=validate.Length(max=64)),
}
go_args = {
'image': fields.Raw(required=True),
}
......@@ -1884,7 +1896,7 @@ class SearchGBHistoryFileView(GenericView):
permission_classes = [IsAuthenticated]
authentication_classes = [OAuth2AuthenticationWithUser]
@use_args(employee_args, location='data')
@use_args(q_gb_file_args, location='data')
def post(self, request, args):
file_path = args.get('file_path')
......@@ -1922,7 +1934,7 @@ class DownloadGBHistoryFileView(GenericView):
permission_classes = [IsAuthenticated]
authentication_classes = [OAuth2AuthenticationWithUser]
@use_args(employee_args, location='data')
@use_args(d_gb_file_args, location='data')
def post(self, request, args):
business_type = args.get('business_type')
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!