From 2f0f5fd37886667e0825a3c625c157e39b03fb1b Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 24 Jan 2025 13:53:38 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardWrite.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/board/BoardWrite.vue b/src/views/board/BoardWrite.vue index cdace2f..b7ef035 100644 --- a/src/views/board/BoardWrite.vue +++ b/src/views/board/BoardWrite.vue @@ -125,7 +125,8 @@ const write = async () => { }; const { data: boardResponse } = await axios.post('board', boardData); - const boardId = boardResponse.data.CMNBRDSEQ; + console.log(boardResponse.data); + const boardId = boardResponse.data; if (attachFiles.value && attachFiles.value.length > 0) { for (const file of attachFiles.value) { From fb12e345a7e0f8b35f839701aba596aec7212ded Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 24 Jan 2025 14:44:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EC=88=98=EC=A0=95=EC=A0=95,=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/FormFile.vue | 48 ++++++++++++++++++++---------- src/components/input/FormInput.vue | 2 +- src/views/board/BoardWrite.vue | 18 ++++++++--- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/components/input/FormFile.vue b/src/components/input/FormFile.vue index 4fbfce7..71070db 100644 --- a/src/components/input/FormFile.vue +++ b/src/components/input/FormFile.vue @@ -1,17 +1,25 @@ - - diff --git a/src/components/input/FormInput.vue b/src/components/input/FormInput.vue index 7f005e6..731824c 100644 --- a/src/components/input/FormInput.vue +++ b/src/components/input/FormInput.vue @@ -2,7 +2,7 @@
@@ -71,8 +72,17 @@
- - + +
@@ -94,6 +104,7 @@ const password = ref(''); const category = ref(0); // 기본값 0 const content = ref(''); const attachFiles = ref(null); +const isFileValid = ref(true); // 파일 유효성 상태 추가 const titleAlert = ref(false); const passwordAlert = ref(false); @@ -112,7 +123,7 @@ const write = async () => { passwordAlert.value = category.value === 1 && !password.value; contentAlert.value = !content.value; - if (titleAlert.value || passwordAlert.value || contentAlert.value) { + if (titleAlert.value || passwordAlert.value || contentAlert.value || !isFileValid.value) { return; } @@ -125,7 +136,6 @@ const write = async () => { }; const { data: boardResponse } = await axios.post('board', boardData); - console.log(boardResponse.data); const boardId = boardResponse.data; if (attachFiles.value && attachFiles.value.length > 0) {