瀏覽代碼

fix: resolve /minio/ page file addr when collecting report data

zhouyang.xie 1 周之前
父節點
當前提交
13726fa1e7
共有 1 個文件被更改,包括 4 次插入 和 1 次删除
  1. 4 1
      app/report/page_source.py

+ 4 - 1
app/report/page_source.py

@@ -84,7 +84,10 @@ def analysis_general_files(batch_code: str, type_codes: List[str]) -> Dict[str,
 
 def fetch_minio_text(file_addr: str, timeout: int = 60) -> Optional[str]:
     """读取 MinIO 对象文本(CSV/JSON),供报告复用页面文件。"""
-    url = f"{MINIO_ENDPOINT}/{MINIO_BUCKET}/{file_addr}"
+    key = file_addr
+    if key.startswith("/minio/"):
+        key = key[len("/minio/"):]
+    url = f"{MINIO_ENDPOINT}/{MINIO_BUCKET}/{key}"
     try:
         r = requests.get(url, timeout=timeout)
         r.raise_for_status()