文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit d7c6ee91 by wyy

文本导出后端

parent d653226e
......@@ -126,12 +126,6 @@ def get_image_file(imageName):
return jsonify({"code": 0, "errmsg": repr(e)})
# 根据图片名称返回图片文件
# def export_image(imageName):
# image = Image.objects(relationId__in=relation_list)
# return False
# documentId获取文本内容
@uploadDownload.route('/getFileContent', methods=['POST'])
def getFileContent():
......@@ -230,3 +224,18 @@ def getExcelContent():
data.update({"content": statement})
return_dict["result"] = data
return json.dumps(return_dict, ensure_ascii=False)
# 下载文本
@uploadDownload.route('/downloadContent', methods=['POST'])
def downloadContent():
get_Data = request.get_data()
get_Data = json.loads(get_Data)
documentId = get_Data.get('documentId')
result = mongodbApi.findOne(collectionTest, {"documentId": documentId})
url = result.get('textUrl')
file_dir = os.path.join(basedir, UPLOAD_FOLDER, url)
return send_file(file_dir, as_attachment=True, attachment_filename=url)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment