diff --git a/be/.gitignore b/be/.gitignore index a4c5ca8..b01e363 100644 --- a/be/.gitignore +++ b/be/.gitignore @@ -6,3 +6,4 @@ __pycache__ /app/projects/* +!/app/projects/test/ \ No newline at end of file diff --git a/be/app/api/v1/files.py b/be/app/api/v1/files.py index 0de7088..af9940c 100644 --- a/be/app/api/v1/files.py +++ b/be/app/api/v1/files.py @@ -98,7 +98,7 @@ def get_json(): # 本线默认目录时app下,所以不需要再加/app了,所以不能用PROJECT_PATH # 2.创建response对象返回数据 #使用response可以将result.json再删除掉 - response = make_response(send_from_directory('', filename=DOWNLOAD_FILE_LOCATION.format(project_name), + response = make_response(send_from_directory(directory='', path=DOWNLOAD_FILE_LOCATION.format(project_name), as_attachment=True)) response.headers["Content-disposition"] = 'attachment; filename={}_result.json'.format(project_name) # print(PROJECT_PATH.format(project_name)+'/result.json')