瀏覽代碼

fix bug of get file (#746)

### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.6.0
KevinHuSh 1 年之前
父節點
當前提交
aa03dfa453
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 2 行新增6 行删除
  1. 2
    6
      api/apps/document_app.py

+ 2
- 6
api/apps/document_app.py 查看文件

@@ -349,12 +349,8 @@ def get(doc_id):
if not e:
return get_data_error_result(retmsg="Document not found!")
informs = File2DocumentService.get_by_document_id(doc_id)
if not informs:
response = flask.make_response(MINIO.get(doc.kb_id, doc.location))
else:
e, file = FileService.get_by_id(informs[0].file_id)
response = flask.make_response(MINIO.get(file.parent_id, doc.location))
b,n = File2DocumentService.get_minio_address(doc_id=doc_id)
response = flask.make_response(MINIO.get(b, n))
ext = re.search(r"\.([^.]+)$", doc.name)
if ext:

Loading…
取消
儲存