From 8d33fafb481ba20bdfad00776ec4c3a29c70fda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 13 Mar 2026 10:14:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[storage]=20R2=20=ED=85=8C=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=ED=8C=8C=EC=9D=BC=20=EA=B2=BD=EB=A1=9C=20URL=20?= =?UTF-8?q?=EB=B3=80=ED=99=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tenant path 패턴(숫자/) 감지하여 API URL 프리픽스 추가 - /storage/tenants/{path} R2 프록시 라우트와 연동 --- .../WorkOrders/documents/TemplateInspectionContent.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/production/WorkOrders/documents/TemplateInspectionContent.tsx b/src/components/production/WorkOrders/documents/TemplateInspectionContent.tsx index 2ac9b8fc..6300cc0f 100644 --- a/src/components/production/WorkOrders/documents/TemplateInspectionContent.tsx +++ b/src/components/production/WorkOrders/documents/TemplateInspectionContent.tsx @@ -76,7 +76,11 @@ function getImageUrl(path: string | null | undefined, fileId?: number | null): s if (!path) return ''; if (path.startsWith('http://') || path.startsWith('https://')) return path; if (path.startsWith('/api/proxy/')) return path; - // R2 전환 후 /storage/ 직접 접근 불가 — 경로만 반환 (fallback) + // API 업로드 형식 (tenant path: 287/temp/2026/02/xxx.jpg) → API 스토리지 직접 접근 + if (/^\d+\//.test(path)) { + const apiUrl = process.env.NEXT_PUBLIC_API_URL || ''; + return `${apiUrl}/storage/tenants/${path}`; + } return path; }