From 8d3305cd04f8101706db73c4d5f162bc33ab6e47 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Thu, 5 Jun 2025 10:49:44 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=BA=94=EB=B2=84=EC=8A=A4=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [작업내용] : 캔버스 화면에서 이벤트 발생 후 캔버스 없는 페이지로 이동시 발생하는 오류 수정 --- src/hooks/useEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index 8b7b687d..43328376 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -401,7 +401,7 @@ export function useEvent() { const removeMouseEvent = (type) => { mouseEventListeners.current = mouseEventListeners.current.filter((event) => { if (event.eventType === type) { - canvas.off(type, event.handler) + canvas?.off(type, event.handler) return false } return true From c6d2904cfecfd005d86fad812abe017671521508 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Thu, 5 Jun 2025 11:14:22 +0900 Subject: [PATCH 2/3] Update environment configuration files to include S3_PROFILE variable for development and production environments; modify image upload path to incorporate S3_PROFILE. --- .env.development | 4 +++- .env.local.dev | 4 +++- .env.localhost | 4 +++- .env.production | 4 +++- src/app/api/image/canvas/route.js | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.env.development b/.env.development index a2e762f7..87c2ba14 100644 --- a/.env.development +++ b/.env.development @@ -27,4 +27,6 @@ AWS_REGION="ap-northeast-1" AMPLIFY_BUCKET="files.hanasys.jp" AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" -NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" + +S3_PROFILE="dev" \ No newline at end of file diff --git a/.env.local.dev b/.env.local.dev index dc91dbc7..ab789dbf 100644 --- a/.env.local.dev +++ b/.env.local.dev @@ -27,4 +27,6 @@ AWS_REGION="ap-northeast-1" AMPLIFY_BUCKET="files.hanasys.jp" AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" -NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" + +S3_PROFILE="dev" \ No newline at end of file diff --git a/.env.localhost b/.env.localhost index bca449ce..8617d87c 100644 --- a/.env.localhost +++ b/.env.localhost @@ -27,4 +27,6 @@ AWS_REGION="ap-northeast-1" AMPLIFY_BUCKET="files.hanasys.jp" AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" -NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" + +S3_PROFILE="dev" \ No newline at end of file diff --git a/.env.production b/.env.production index 6295bb97..bb3dfbf0 100644 --- a/.env.production +++ b/.env.production @@ -28,4 +28,6 @@ AWS_REGION="ap-northeast-1" AMPLIFY_BUCKET="files.hanasys.jp" AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" AWS_SECRET_ACCESS_KEY="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" -NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" + +S3_PROFILE="prd" \ No newline at end of file diff --git a/src/app/api/image/canvas/route.js b/src/app/api/image/canvas/route.js index 0a4d0be2..77d1c95c 100644 --- a/src/app/api/image/canvas/route.js +++ b/src/app/api/image/canvas/route.js @@ -96,7 +96,7 @@ export async function POST(req) { /** * 크롭 이미지 이름을 결정한다. */ - const Key = `Drawing/${objectNo}_${planNo}_${type}.png` + const Key = `Drawing/${process.env.S3_PROFILE}/${objectNo}_${planNo}_${type}.png` /** * 크롭이 완료된 이미지를 업로드한다. From 946aa231a35bbfe371e7512cfb778651ee23136e Mon Sep 17 00:00:00 2001 From: yjnoh Date: Thu, 5 Jun 2025 11:28:08 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=8B=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=9A=B4=EC=98=81,=20=EA=B0=9C=EB=B0=9C?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/image/estimate-image-copy/route.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/api/image/estimate-image-copy/route.js b/src/app/api/image/estimate-image-copy/route.js index d7c80b13..81e5c13c 100644 --- a/src/app/api/image/estimate-image-copy/route.js +++ b/src/app/api/image/estimate-image-copy/route.js @@ -20,7 +20,7 @@ export async function POST(req) { const isExistImage1 = await s3.send( new GetObjectCommand({ Bucket, - Key: `Drawing/${objectNo}_${planNo}_1.png`, + Key: `Drawing/${process.env.S3_PROFILE}/${objectNo}_${planNo}_1.png`, }), ) @@ -28,7 +28,7 @@ export async function POST(req) { const isExistImage2 = await s3.send( new GetObjectCommand({ Bucket, - Key: `Drawing/${objectNo}_${planNo}_2.png`, + Key: `Drawing/${process.env.S3_PROFILE}/${objectNo}_${planNo}_2.png`, }), ) @@ -37,16 +37,16 @@ export async function POST(req) { //견적서1 번 이미지 복사 const copyCommand = new CopyObjectCommand({ Bucket, - CopySource: encodeURI(`${Bucket}/Drawing/${objectNo}_${planNo}_1.png`), - Key: `Drawing/${newObjectNo}_${newPlanNo}_1.png`, + CopySource: encodeURI(`${Bucket}/Drawing/${process.env.S3_PROFILE}/${objectNo}_${planNo}_1.png`), + Key: `Drawing/${process.env.S3_PROFILE}/${newObjectNo}_${newPlanNo}_1.png`, }) const response = await s3.send(copyCommand) const copyCommand2 = new CopyObjectCommand({ Bucket, - CopySource: encodeURI(`${Bucket}/Drawing/${objectNo}_${planNo}_2.png`), - Key: `Drawing/${newObjectNo}_${newPlanNo}_2.png`, + CopySource: encodeURI(`${Bucket}/Drawing/${process.env.S3_PROFILE}/${objectNo}_${planNo}_2.png`), + Key: `Drawing/${process.env.S3_PROFILE}/${newObjectNo}_${newPlanNo}_2.png`, }) const response2 = await s3.send(copyCommand2)