فهرست منبع

files 改变路径

liweiquan 2 سال پیش
والد
کامیت
ac12672338
1فایلهای تغییر یافته به همراه12 افزوده شده و 12 حذف شده
  1. 12 12
      app/routers/files.py

+ 12 - 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()
@@ -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
+