From cb38985b08a18d08bd2e70c72ccb559123363b3d Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Mon, 10 Feb 2025 15:03:16 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20POST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardProfile.vue | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index dba9220..f4aa5e4 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -151,16 +151,33 @@ const togglePassword = (button) => { }; // 비밀번호 확인 -const handlePasswordSubmit = () => { +const handlePasswordSubmit = async () => { isPassword.value = false; lastClickedButton.value = null; console.log('비밀번호:', password.value); + console.log(props.boardId) - - + try { + const requestData = { + MEMBERSEQ: 1, + LOCCMTPWD: password.value + } - // router.push({ name: 'BoardEdit', params: { id: props.boardId } }); // 편집 예시 + console.log(requestData) + + const postResponse = await axios.post(`board/${props.boardId}/password`, requestData); + + console.log('post결과:', postResponse.data) + + // if (response.data.code === 200 && response.data.data === true) { + // console.log("완료"); // 비밀번호가 맞으면 출력 + // } else { + // console.log("비밀번호가 틀립니다."); + // } + } catch (error) { + console.error('비밀번호 확인 중 오류 발생:', error); + } }; const deletePost = async () => {