|
@@ -19,18 +19,6 @@ router = APIRouter(
|
|
|
tags=["files-文件管理"],
|
|
|
)
|
|
|
|
|
|
-@router.get("/{uri:path}",name="path-convertor")
|
|
|
-@sxtimeit
|
|
|
-def get_file(uri: str):
|
|
|
- print("===",uri)
|
|
|
- file = minio_client.get_file(uri)
|
|
|
- code = 200
|
|
|
- if len(file) == 0:
|
|
|
- code = 404
|
|
|
- response = StreamingResponse(io.BytesIO(file), status_code=code, media_type="application/octet-stream")
|
|
|
- # 在请求头进行配置
|
|
|
- response.headers["Content-Disposition"] = "attachment; filename="+uri
|
|
|
- return response
|
|
|
|
|
|
@router.delete("/dag")
|
|
|
@web_try()
|
|
@@ -79,5 +67,17 @@ def get_dag_content(uri: str):
|
|
|
res = json.loads(file)
|
|
|
return res
|
|
|
|
|
|
+@router.get("/{uri:path}",name="path-convertor")
|
|
|
+@sxtimeit
|
|
|
+def get_file(uri: str):
|
|
|
+ file = minio_client.get_file(uri)
|
|
|
+ code = 200
|
|
|
+ if len(file) == 0:
|
|
|
+ code = 404
|
|
|
+ response = StreamingResponse(io.BytesIO(file), status_code=code, media_type="application/octet-stream")
|
|
|
+ # 在请求头进行配置
|
|
|
+ response.headers["Content-Disposition"] = "attachment; filename="+uri
|
|
|
+ return response
|
|
|
+
|
|
|
|
|
|
|