diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index dba9220..7a4e538 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -74,9 +74,9 @@ const router = useRouter(); // Props 정의 const props = defineProps({ - boardId: { - type: Number, - required: true + boardId: { + type: Number, + required: true }, profileName: { type: String, @@ -125,7 +125,7 @@ const handleEdit = () => { // router.push({ name: 'BoardEdit', params: { id: boardId } }); if (props.unknown) { - togglePassword('edit'); + togglePassword('edit'); } else { router.push({ name: 'BoardEdit', params: { id: 100 } }); // 로그인한 경우 바로 편집 } @@ -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 = { + LOCBRDPWD: password.value, + LOCBRDSEQ: 288 + } - // 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 () => { diff --git a/src/components/wordDict/DictWrite.vue b/src/components/wordDict/DictWrite.vue index eccf5a3..985c69d 100644 --- a/src/components/wordDict/DictWrite.vue +++ b/src/components/wordDict/DictWrite.vue @@ -1,39 +1,49 @@ @@ -124,3 +134,15 @@ const saveWord = () => { emit('addWord', wordData); }; + + \ No newline at end of file diff --git a/src/views/wordDict/wordDict.vue b/src/views/wordDict/wordDict.vue index 36a8641..3c494aa 100644 --- a/src/views/wordDict/wordDict.vue +++ b/src/views/wordDict/wordDict.vue @@ -172,7 +172,7 @@ }).then(res => { if(res.data.data == '1'){ toastStore.onToast('카테고리가 추가 등록 되었습니다.', 's'); - const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; // Assuming CMNCODVAL is the same as CMNCODNAM + const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; cateList.value.unshift(newCategory); selectCategory.value = newCategory.CMNCODVAL; } @@ -181,10 +181,6 @@ //용어 등록 const addWord = (wordData) => { - // console.log('단어 추가됨:', wordData.category); // WRDDICCAT - // console.log('단어 추가됨:', wordData.content); // WRDDICCON - // console.log('단어 추가됨:', wordData.title); // WRDDICTTL - axios.post('worddict/insertWord',{ WRDDICCAT : wordData.category, WRDDICTTL : wordData.title, @@ -192,10 +188,8 @@ }).then(res => { if(res.data.data == '1'){ toastStore.onToast('용어가 등록 되었습니다.', 's'); - isWriteVisible.value = false - // const newCategory = { CMNCODNAM: data, CMNCODVAL: newValue.toString() }; - // cateList.value.unshift(newCategory); - // selectCategory.value = newCategory.CMNCODVAL; + isWriteVisible.value = false; + getwordList(); } }) };