게시판 수정, 삭제 완료
This commit is contained in:
parent
5c88ea3115
commit
e2d765cb15
@ -20,7 +20,7 @@
|
||||
/>
|
||||
|
||||
<!-- 비밀번호 입력창 (익명일 경우) -->
|
||||
<div v-if="isPassword && unknown" class="mt-3 w-25">
|
||||
<div v-if="isPassword && unknown" class="mt-3 w-25 ms-auto">
|
||||
<div class="input-group">
|
||||
<input
|
||||
type="password"
|
||||
@ -240,12 +240,12 @@ const fetchComments = async (page = 1) => {
|
||||
page
|
||||
}
|
||||
});
|
||||
// const replyResponse = await axios.get(`board/${currentBoardId.value}/reply`, {
|
||||
// params: { LOCBRDSEQ: currentBoardId.value }
|
||||
// });
|
||||
const replyResponse = await axios.get(`board/${currentBoardId.value}/reply`, {
|
||||
params: { LOCBRDSEQ: currentBoardId.value }
|
||||
});
|
||||
|
||||
console.log("댓글:", response.data);
|
||||
// console.log("대댓글:", replyResponse.data);
|
||||
console.log("대댓글:", replyResponse.data);
|
||||
|
||||
comments.value = response.data.data.list.map(comment => ({
|
||||
commentId: comment.LOCCMTSEQ, // 댓글 ID
|
||||
@ -258,7 +258,6 @@ const fetchComments = async (page = 1) => {
|
||||
children: [] // 대댓글을 담을 배열
|
||||
}));
|
||||
|
||||
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
currentPage: response.data.data.pageNum, // 현재 페이지 번호
|
||||
@ -276,7 +275,7 @@ const fetchComments = async (page = 1) => {
|
||||
};
|
||||
|
||||
} catch (error) {
|
||||
console.error('댓글 목록 불러오기 오류:', error);
|
||||
console.log('댓글 목록 불러오기 오류:', error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -295,10 +294,10 @@ const handleCommentSubmit = async ({ comment, password }) => {
|
||||
console.log('댓글 작성 성공:', response.data.message);
|
||||
await fetchComments();
|
||||
} else {
|
||||
console.error('댓글 작성 실패:', response.data.message);
|
||||
console.log('댓글 작성 실패:', response.data.message);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('댓글 작성 중 오류 발생:', error);
|
||||
console.log('댓글 작성 중 오류 발생:', error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -314,7 +313,7 @@ const handleCommentReply = async (reply) => {
|
||||
console.log('대댓글 작성 성공:', response.data.message);
|
||||
await fetchComments();
|
||||
} else {
|
||||
console.error('대댓글 작성 실패:', response.data.message);
|
||||
console.log('대댓글 작성 실패:', response.data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +350,7 @@ const submitPassword = async () => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("📌 요청 시작: submitPassword 실행됨");
|
||||
// console.log("📌 요청 시작: submitPassword 실행됨");
|
||||
|
||||
try {
|
||||
const response = await axios.post(`board/${currentBoardId.value}/password`, {
|
||||
@ -361,7 +360,6 @@ const submitPassword = async () => {
|
||||
|
||||
if (response.data.code === 200 && response.data.data === true) {
|
||||
password.value = '';
|
||||
// passwordAlert.value = "";
|
||||
isPassword.value = false;
|
||||
|
||||
if (lastClickedButton.value === "edit") {
|
||||
@ -371,24 +369,20 @@ const submitPassword = async () => {
|
||||
}
|
||||
lastClickedButton.value = null;
|
||||
} else {
|
||||
console.log('비밀번호 틀렸음둥')
|
||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.????";
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.response) {
|
||||
console.error("📌 서버 응답 상태 코드:", error.response.status);
|
||||
console.error("📌 서버 응답 데이터:", error.response.data);
|
||||
// console.log("📌 전체 오류:", error);
|
||||
|
||||
if (error.response) {
|
||||
if (error.response.status === 401) {
|
||||
passwordAlert.value = "비밀번호가 일치하지 않습니다.";
|
||||
} else {
|
||||
passwordAlert.value = error.response.data?.message || "서버 오류가 발생했습니다.";
|
||||
}
|
||||
} else if (error.request) {
|
||||
console.error("📌 요청이 서버에 도달하지 못함:", error.request);
|
||||
passwordAlert.value = "네트워크 오류가 발생했습니다. 다시 시도해주세요.";
|
||||
} else {
|
||||
console.error("📌 요청 설정 중 오류 발생:", error.message);
|
||||
passwordAlert.value = "요청 중 알 수 없는 오류가 발생했습니다.";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user