Browse Source

Merge remote-tracking branch 'origin/master'

luoyulong 2 years ago
parent
commit
d53b73bbf8
1 changed files with 14 additions and 12 deletions
  1. 14 12
      app/routers/files.py

+ 14 - 12
app/routers/files.py

@@ -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()
@@ -80,4 +68,18 @@ def get_dag_content(uri: str):
     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
+
+