diff --git a/src/components/auth/Join.jsx b/src/components/auth/Join.jsx index 4062d313..94f7fa3e 100644 --- a/src/components/auth/Join.jsx +++ b/src/components/auth/Join.jsx @@ -6,7 +6,7 @@ import { useRouter } from 'next/navigation' import { useMessage } from '@/hooks/useMessage' import Cookies from 'js-cookie' -import { isObjectNotEmpty, inputTelNumberCheck, inputNumberCheck } from '@/util/common-utils' +import { isObjectNotEmpty, inputTelNumberCheck, inputNumberCheck, inputUserIdCheck } from '@/util/common-utils' import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' @@ -133,6 +133,13 @@ export default function Join() { alert(getMessage('common.message.required.data', [getMessage('join.sub2.userId')])) userIdRef.current.focus() return false + } else { + const userIdRegex = /^[A-Za-z0-9!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]+$/ + if (!userIdRegex.test(userId)) { + alert(getMessage('join.validation.check1', [getMessage('join.sub2.userId')])) + userIdRef.current.focus() + return false + } } // 담당자 정보 - 이메일 주소 @@ -436,7 +443,15 @@ export default function Join() {
- +
diff --git a/src/hooks/roofcover/useAuxiliaryDrawing.js b/src/hooks/roofcover/useAuxiliaryDrawing.js index ab0af73e..c84e00a7 100644 --- a/src/hooks/roofcover/useAuxiliaryDrawing.js +++ b/src/hooks/roofcover/useAuxiliaryDrawing.js @@ -496,6 +496,10 @@ export function useAuxiliaryDrawing(id, isUseEffect = true) { mousePointerArr.current.push({ x: lastPoint.x + length1Value / 10, y: lastPoint.y + length2Value / 10 }) } else if (arrow1Value === '→' && arrow2Value === '↑') { mousePointerArr.current.push({ x: lastPoint.x + length1Value / 10, y: lastPoint.y - length2Value / 10 }) + } else if (arrow1Value === '←' && arrow2Value === '↓') { + mousePointerArr.current.push({ x: lastPoint.x - length1Value / 10, y: lastPoint.y + length2Value / 10 }) + } else if (arrow1Value === '←' && arrow2Value === '↑') { + mousePointerArr.current.push({ x: lastPoint.x - length1Value / 10, y: lastPoint.y - length2Value / 10 }) } drawLine() } diff --git a/src/hooks/roofcover/useOuterLineWall.js b/src/hooks/roofcover/useOuterLineWall.js index 850a761a..dbd9f104 100644 --- a/src/hooks/roofcover/useOuterLineWall.js +++ b/src/hooks/roofcover/useOuterLineWall.js @@ -678,6 +678,32 @@ export function useOuterLineWall(id, propertiesId) { }, ] }) + } else if (arrow1Value === '←' && arrow2Value === '↓') { + setPoints((prev) => { + if (prev.length === 0) { + return [] + } + return [ + ...prev, + { + x: prev[prev.length - 1].x - length1Value / 10, + y: prev[prev.length - 1].y + length2Value / 10, + }, + ] + }) + } else if (arrow1Value === '←' && arrow2Value === '↑') { + setPoints((prev) => { + if (prev.length === 0) { + return [] + } + return [ + ...prev, + { + x: prev[prev.length - 1].x - length1Value / 10, + y: prev[prev.length - 1].y - length2Value / 10, + }, + ] + }) } } } diff --git a/src/hooks/surface/usePlacementShapeDrawing.js b/src/hooks/surface/usePlacementShapeDrawing.js index 3dfea465..ee151307 100644 --- a/src/hooks/surface/usePlacementShapeDrawing.js +++ b/src/hooks/surface/usePlacementShapeDrawing.js @@ -680,6 +680,32 @@ export function usePlacementShapeDrawing(id) { }, ] }) + } else if (arrow1Value === '←' && arrow2Value === '↓') { + setPoints((prev) => { + if (prev.length === 0) { + return [] + } + return [ + ...prev, + { + x: prev[prev.length - 1].x - length1Value / 10, + y: prev[prev.length - 1].y + length2Value / 10, + }, + ] + }) + } else if (arrow1Value === '←' && arrow2Value === '↑') { + setPoints((prev) => { + if (prev.length === 0) { + return [] + } + return [ + ...prev, + { + x: prev[prev.length - 1].x - length1Value / 10, + y: prev[prev.length - 1].y - length2Value / 10, + }, + ] + }) } } } diff --git a/src/util/common-utils.js b/src/util/common-utils.js index 0a1265fe..2b3fe37d 100644 --- a/src/util/common-utils.js +++ b/src/util/common-utils.js @@ -94,6 +94,17 @@ export const inputNumberCheck = (e) => { } } +// 영문, 숫자, 특수문자(ASCII)만 입력 체크 +export const inputUserIdCheck = (e) => { + const input = e.target + const allowedRegex = /^[A-Za-z0-9!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]*$/g + if (allowedRegex.test(input.value)) { + input.value = input.value + } else { + input.value = input.value.replace(/[^A-Za-z0-9!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?`~]/g, '') + } +} + // 값이 숫자인지 확인 export const numberCheck = (value) => { return !isNaN(value)