From f0a79e9ea240dd7ccf757cca350b408fe85eaab4 Mon Sep 17 00:00:00 2001 From: AnCha Date: Fri, 31 May 2024 01:08:08 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Chore=20:=20=ED=83=90=EC=83=89=20=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=20=ED=99=95=EC=9D=B8=20=EA=B8=B0=EB=8A=A5=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=B2=98=EB=A6=AC=20#299?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/guardianMain/StepContents.js | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/guardianMain/StepContents.js b/frontend/src/components/guardianMain/StepContents.js index 73fcffad72..c73cc140e2 100644 --- a/frontend/src/components/guardianMain/StepContents.js +++ b/frontend/src/components/guardianMain/StepContents.js @@ -24,10 +24,12 @@ export const StepContents = ({ index, current }) => { process: { content: "등록된 정보로 지능형 탐색 중입니다." }, finish: { content: "탐색 완료했습니다.", - buttonText: "탐색 결과 확인하기", - callBack: () => { - navigate("/result", { state: { title: "1차 탐색 결과", step: "first" } }); - }, + buttonText: "", + callBack: () => {}, + // buttonText: "탐색 결과 확인하기", + // callBack: () => { + // navigate("/result", { state: { title: "1차 탐색 결과", step: "first" } }); + // }, }, }, { @@ -47,10 +49,12 @@ export const StepContents = ({ index, current }) => { }, finish: { content: "이미지 선택 완료했습니다.", - buttonText: "선별 이미지 확인하기", - callBack: () => { - navigate("/result", { state: { title: "선별 이미지 확인", step: "between" } }); - }, + buttonText: "", + callBack: () => {}, + // buttonText: "선별 이미지 확인하기", + // callBack: () => { + // navigate("/result", { state: { title: "선별 이미지 확인", step: "between" } }); + // }, }, }, { @@ -60,10 +64,12 @@ export const StepContents = ({ index, current }) => { process: { content: "등록된 정보로 지능형 탐색 중입니다." }, finish: { content: "탐색 완료했습니다.", - buttonText: "탐색 결과 확인하기", - callBack: () => { - navigate("/result", { state: { title: "2차 탐색 결과", step: "second" } }); - }, + buttonText: "", + callBack: () => {}, + // buttonText: "탐색 결과 확인하기", + // callBack: () => { + // navigate("/result", { state: { title: "2차 탐색 결과", step: "second" } }); + // }, }, }, { From 4ed7175fef7832cffc11ded5ac458a8a9c8a0112 Mon Sep 17 00:00:00 2001 From: AnCha Date: Fri, 31 May 2024 02:14:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Chore=20:=20=EC=BA=A1=EC=B3=90=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=20=EA=B8=B0=EB=8A=A5=20=EB=B3=B4=EC=99=84=20#299?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/GuardianSelectImgPage.js | 27 ++++++++++++++++---- frontend/src/pages/GuardianShowResultPage.js | 24 +++++++++++++++++ 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/GuardianSelectImgPage.js b/frontend/src/pages/GuardianSelectImgPage.js index 90c8e6b950..eaa2669340 100644 --- a/frontend/src/pages/GuardianSelectImgPage.js +++ b/frontend/src/pages/GuardianSelectImgPage.js @@ -94,16 +94,33 @@ function GuardianSelectImgPage() { getGuardianSelectImage().then((data) => { setData(data); }); + + // 우클릭 방지 + document.addEventListener("contextmenu", preventContextMenu); + // 화면 캡쳐 방지 키 조합 + document.addEventListener("keydown", preventScreenshot); + // 모바일 화면 캡쳐 방지 + window.addEventListener("blur", handleBlur); + + return () => { + document.removeEventListener("contextmenu", preventContextMenu); + document.removeEventListener("keydown", preventScreenshot); + window.removeEventListener("blur", handleBlur); + }; }, []); - // JavaScript로 화면 캡처 방지 설정 - document.addEventListener("contextmenu", (e) => e.preventDefault()); - document.addEventListener("keydown", (e) => { + const preventContextMenu = (e) => e.preventDefault(); + + const preventScreenshot = (e) => { if (e.key === "PrintScreen" || (e.ctrlKey && e.key === "p")) { e.preventDefault(); - alert("Screen capture is disabled"); + alert("화면 캡쳐가 금지되어 있습니다."); } - }); + }; + + const handleBlur = () => { + alert("화면 캡쳐가 감지되었습니다."); + }; const onSelect = (select) => { setSelectedImg((prev) => { diff --git a/frontend/src/pages/GuardianShowResultPage.js b/frontend/src/pages/GuardianShowResultPage.js index 575b9f25c8..887a913cfa 100644 --- a/frontend/src/pages/GuardianShowResultPage.js +++ b/frontend/src/pages/GuardianShowResultPage.js @@ -17,7 +17,31 @@ function GuardianShowResultPage() { useEffect(() => { fetchData(); + // 우클릭 방지 + document.addEventListener("contextmenu", preventContextMenu); + // 화면 캡쳐 방지 키 조합 + document.addEventListener("keydown", preventScreenshot); + // 모바일 화면 캡쳐 방지 + window.addEventListener("blur", handleBlur); + + return () => { + document.removeEventListener("contextmenu", preventContextMenu); + document.removeEventListener("keydown", preventScreenshot); + window.removeEventListener("blur", handleBlur); + }; }, []); + const preventContextMenu = (e) => e.preventDefault(); + + const preventScreenshot = (e) => { + if (e.key === "PrintScreen" || (e.ctrlKey && e.key === "p")) { + e.preventDefault(); + alert("화면 캡쳐가 금지되어 있습니다."); + } + }; + + const handleBlur = () => { + alert("화면 캡쳐가 감지되었습니다."); + }; useEffect(() => {}, [data]);