This commit is contained in:
zlwu committed 2026-08-01 22:49:11 +08:00
1 parent e59b2aa6cb
commit eccefc6650
63 files changed
+13267 -11330

No files matched your search

+2 -6
View File
@@ -1,7 +1,6 @@
"""报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。"""
from __future__ import annotations
from datetime import timedelta
from io import BytesIO
from pathlib import Path
@@ -58,11 +57,8 @@ def get_preview_url(file_path: str, *, expires_seconds: int = 3600) -> str:
if not key:
return ""
if isinstance(store, MinIOStorage):
return store.client.presigned_get_object(
bucket_name=store.bucket_name,
object_name=key,
expires=timedelta(seconds=expires_seconds),
)
# 走 MinIOStorage.presigned_preview_url(按 MINIO_BASE_URL 公网域名签发)
return store.presigned_preview_url(key, expires_seconds=expires_seconds)
return store.get_url(key)