fix file preview in file management (#1151)

### What problem does this PR solve?

fix file preview in file management

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
KevinHuSh
2024-06-14 10:33:59 +08:00
committed by GitHub
parent 64c83f300a
commit 2023fdc13e
10 changed files with 203 additions and 11 deletions

View File

@ -331,8 +331,8 @@ def get(file_id):
e, file = FileService.get_by_id(file_id)
if not e:
return get_data_error_result(retmsg="Document not found!")
response = flask.make_response(MINIO.get(file.parent_id, file.location))
b, n = File2DocumentService.get_minio_address(file_id=file_id)
response = flask.make_response(MINIO.get(b, n))
ext = re.search(r"\.([^.]+)$", file.name)
if ext:
if file.type == FileType.VISUAL.value:
@ -345,7 +345,8 @@ def get(file_id):
return response
except Exception as e:
return server_error_response(e)
@manager.route('/mv', methods=['POST'])
@login_required
@validate_request("src_file_ids", "dest_file_id")