Ver código fonte

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

zhouyang.xie 1 semana atrás
pai
commit
13726fa1e7
1 arquivos alterados com 4 adições e 1 exclusões
  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()