change to flask 2.0

This commit is contained in:
xgdyp 2021-07-09 21:52:28 +08:00
parent 223aba983f
commit 8212a2b32f
2 changed files with 2 additions and 1 deletions

1
be/.gitignore vendored
View File

@ -6,3 +6,4 @@ __pycache__
/app/projects/*
!/app/projects/test/

View File

@ -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')