feat: CSP 다음/카카오 도메인 허용 + 입고 성적서 파일 백엔드 연동 + 팝업 이미지 중앙정렬
- middleware CSP: *.kakao.com, *.kakaocdn.net 추가 (다음 주소찾기 차단 해결) - frame-src에 'self' 추가 - 공지 팝업 이미지 중앙정렬 ([&_img]:mx-auto) - HR 사원관리, 결재, 품목, 생산 등 다수 개선 - API 에러 핸들링 및 JSON 파싱 안정화
This commit is contained in:
@@ -68,15 +68,16 @@ interface TemplateInspectionContentProps {
|
||||
|
||||
// ===== 유틸 =====
|
||||
|
||||
/** API 저장소 이미지 URL 생성 (사원관리와 동일 패턴) */
|
||||
function getImageUrl(path: string | null | undefined): string {
|
||||
/** API 저장소 이미지 URL 생성 — R2 전환 후 프록시 사용 */
|
||||
function getImageUrl(path: string | null | undefined, fileId?: number | null): string {
|
||||
if (!path && !fileId) return '';
|
||||
// file_id가 있으면 프록시 경로 사용
|
||||
if (fileId) return `/api/proxy/files/${fileId}/view`;
|
||||
if (!path) return '';
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) return path;
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL || '';
|
||||
// tenant storage 경로 (숫자/로 시작: {tenant_id}/temp/...)
|
||||
if (/^\d+\//.test(path)) return `${apiUrl}/storage/tenants/${path}`;
|
||||
// 레거시 경로 (document-templates/xxx.jpg 등)
|
||||
return `${apiUrl}/storage/${path}`;
|
||||
if (path.startsWith('/api/proxy/')) return path;
|
||||
// R2 전환 후 /storage/ 직접 접근 불가 — 경로만 반환 (fallback)
|
||||
return path;
|
||||
}
|
||||
|
||||
/** field_values.reference_attribute에서 작업 아이템의 실제 치수를 resolve */
|
||||
|
||||
Reference in New Issue
Block a user