diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index 965f6d7..82b54ea 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -165,7 +165,6 @@ const handleEditClick = () => {
}
const handleReplyEditClick = (event) => {
- console.log("π editClick μ΄λ²€νΈ μ€νλ¨! μ λ¬λ λ°μ΄ν°:", event);
emit('editClick', event);
}
diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue
index c3c4f91..cf43b87 100644
--- a/src/components/board/BoardProfile.vue
+++ b/src/components/board/BoardProfile.vue
@@ -4,6 +4,7 @@
+
{{ profileName }}
@@ -94,7 +95,7 @@ const props = defineProps({
isLike: {
type: Boolean,
default: false,
- }
+ },
});
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
@@ -117,6 +118,10 @@ const handleUpdateReaction = (reactionData) => {
});
};
+const getProfileImage = (profilePath) => {
+ return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile;
+};
+
diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue
index 095e5e3..3ac8ef0 100644
--- a/src/views/board/BoardList.vue
+++ b/src/views/board/BoardList.vue
@@ -195,10 +195,7 @@ const fetchGeneralPosts = async (page = 1) => {
});
if (data?.data) {
- // console.log(data)
- const totalPosts = data.data.total; // μ 체 κ²μλ¬Ό κ°μ λ°μμ€κΈ°
-
- // console.log('π API μλ΅ λ°μ΄ν°:', data.data);
+ const totalPosts = data.data.total;
generalList.value = data.data.list.map((post, index) => ({
realId: post.id,
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index 725dd2a..30d7921 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -76,13 +76,7 @@
@updateReaction="handleUpdateReaction"
/>
-
-
-
-
-
+
@@ -173,7 +166,6 @@ const commentsWithAuthStatus = computed(() => {
isCommentAuthor: reply.authorId === currentUserId.value,
}))
}));
- // console.log("β
commentsWithAuthStatus μ
λ°μ΄νΈλ¨:", updatedComments);
return updatedComments;
});
@@ -210,20 +202,12 @@ const fetchBoardDetails = async () => {
const response = await axios.get(`board/${currentBoardId.value}`);
const data = response.data.data;
- // console.log(data)
// API μλ΅ λ°μ΄ν° λ°μ
// const boardDetail = data.boardDetail || {};
profileName.value = data.author || 'μ΅λͺ
';
- // μ΅λͺ
νμΈνκ³ μΆμλ
- // profileName.value = 'μ΅λͺ
';
-
- // console.log("π κ²μκΈ μμ±μ:", profileName.value); // μμ±μ μ΄λ¦ μΆλ ₯
- // console.log("π μ΅λͺ
μ¬λΆ (unknown.value):", unknown.value); // μ΅λͺ
μ¬λΆ νμΈ
-
-
authorId.value = data.authorId; //κ²μκΈ μμ±μ id
boardTitle.value = data.title || 'μ λͺ© μμ';
boardContent.value = data.content || '';
@@ -245,7 +229,6 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) =
await axios.post(`/board/${boardId}/${commentId}/reaction`, {
LOCBRDSEQ: boardId, // κ²μκΈ id
LOCCMTSEQ: commentId, //λκΈ id
- // MEMBERSEQ: 1, // λ©€λ²μμ΄λ μ§κΈμ 1 λμ€μ μμ ν΄μΌν¨
LOCGOBGOD: isLike ? 'T' : 'F',
LOCGOBBAD: isDislike ? 'T' : 'F'
});
@@ -258,13 +241,9 @@ const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) =
likeClicked.value = isLike;
dislikeClicked.value = isDislike;
- // console.log(updatedData)
-
- // console.log("κ°±μ λ λ°μ΄ν°:", updatedData);
} catch (error) {
alert('μ€λ₯κ° λ°μνμ΅λλ€.');
- // console.log('λ°μμ μ
λ°μ΄νΈνλ μ€ μ€λ₯κ° λ°μνμ΅λλ€.');
}
};
@@ -281,13 +260,10 @@ const handleCommentReaction = async ({ boardId, commentId, isLike, isDislike })
LOCGOBBAD: isDislike ? 'T' : 'F'
});
- // console.log("λκΈ μ’μμ API μλ΅ λ°μ΄ν°:", response.data);
-
await fetchComments();
} catch (error) {
alert('μ€λ₯κ° λ°μνμ΅λλ€.');
- // console.log('λκΈ λ°μμ μ
λ°μ΄νΈνλ μ€ μ€λ₯ λ°μ');
}
};
@@ -302,8 +278,6 @@ const fetchComments = async (page = 1) => {
}
});
- // console.log(response.data.data)
-
const commentsList = response.data.data.list.map(comment => ({
commentId: comment.LOCCMTSEQ, // λκΈ ID
boardId: comment.LOCBRDSEQ,
@@ -329,8 +303,6 @@ const fetchComments = async (page = 1) => {
params: { LOCCMTPNT: comment.commentId }
});
- // console.log(`λλκΈ λ°μ΄ν° (${comment.commentId}μ λλκΈ):`, replyResponse.data);
-
if (replyResponse.data.data) {
comment.children = replyResponse.data.data.map(reply => ({
author: reply.author || 'μ΅λͺ
',
@@ -370,18 +342,15 @@ const fetchComments = async (page = 1) => {
navigateLastPage: response.data.data.navigateLastPage // νμ΄μ§λ€μ΄μ
μμ λ§μ§λ§ νμ΄μ§ λ²νΈ
};
- // console.log("π λκΈ λͺ©λ‘:", comments.value);
} catch (error) {
alert('μ€λ₯κ° λ°μνμ΅λλ€.');
- // alert('λκΈ λͺ©λ‘ λΆλ¬μ€κΈ° μ€λ₯:', error);
}
};
// λκΈ μμ±
const handleCommentSubmit = async (data) => {
if (!data) {
- console.error("handleCommentSubmit: dataκ° undefinedμ
λλ€.");
return;
}
@@ -432,8 +401,8 @@ const handleCommentReply = async (reply) => {
});
if (response.status === 200) {
- if (response.data.code === 200) { // μλ² μλ΅ μ½λλ νμΈ
- await fetchComments(); // λκΈ λͺ©λ‘ μλ‘κ³ μΉ¨
+ if (response.data.code === 200) {
+ await fetchComments();
} else {
alert('λλκΈ μμ±μ μ€ν¨νμ΅λλ€.');
}
@@ -443,7 +412,6 @@ const handleCommentReply = async (reply) => {
alert("μ€λ₯κ° λ°μνμ΅λλ€.");
}
alert("μ€λ₯κ° λ°μνμ΅λλ€.");
-
}
}
@@ -482,41 +450,33 @@ const findCommentById = (commentId, commentsList) => {
// λκΈ μμ λ²νΌ ν΄λ¦
const editComment = (comment) => {
- // λΆλͺ¨ λλ λλκΈμ μ°Ύμμ κ°μ Έμ€κΈ°
const targetComment = findCommentById(comment.commentId, comments.value);
if (!targetComment) {
return;
}
- // λκΈ μμ±μκ° νμ¬ λ‘κ·ΈμΈν μ¬μ©μμ λμΌνμ§ νμΈ
const isMyComment = comment.authorId === currentUserId.value;
const isAnonymous = comment.author === "μ΅λͺ
";
if (isMyComment) {
- // λ³ΈμΈ λκΈμ΄λ©΄ λ°λ‘ μμ λͺ¨λ νμ±ν
targetComment.isEditTextarea = !targetComment.isEditTextarea;
} else if (isAnonymous) {
- // μ΅λͺ
λκΈμ΄λ©΄ λΉλ°λ²νΈ μ
λ ₯μ°½ λμ°κΈ°
toggleCommentPassword(comment, "edit");
} else {
- // console.log("λ€λ₯Έ μ¬μ©μ λκΈ - μμ λΆκ°");
alert("μμ μ΄ λΆκ°λ₯ν©λλ€");
}
}
// λκΈ μμ λ²νΌ ν΄λ¦
const deleteComment = async (comment) => {
- // μ΅λͺ
μ¬μ©μμΈ κ²½μ°
const isMyComment = comment.authorId === currentUserId.value;
if (unknown.value && !isMyComment) {
if (comment.isEditTextarea) {
- // νμ¬ μμ μ€μ΄λΌλ©΄ μμ λͺ¨λλ₯Ό λκ³ , μμ λΉλ°λ²νΈ μ
λ ₯μ°½μ λμ
comment.isEditTextarea = false;
comment.isCommentPassword = true;
} else {
- // μμ μ€μ΄ μλλ©΄ κΈ°μ‘΄μ μμ λΉλ°λ²νΈ μ
λ ₯μ°½μ λμ°λ λ‘μ§ μ€ν
toggleCommentPassword(comment, "delete");
}
} else {
@@ -554,7 +514,7 @@ const submitPassword = async () => {
try {
const response = await axios.post(`board/${currentBoardId.value}/password`, {
LOCBRDPWD: password.value,
- LOCBRDSEQ: 288, // λμ€μ νμ¬ κ²μκΈ ID μ¬μ©ν΄μΌν¨
+ LOCBRDSEQ: 288,
});
if (response.data.code === 200 && response.data.data === true) {
@@ -571,8 +531,6 @@ const submitPassword = async () => {
passwordAlert.value = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€.";
}
} catch (error) {
- // console.log("π μ 체 μ€λ₯:", error);
-
if (error.response) {
if (error.response.status === 401) {
passwordAlert.value = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€.";
@@ -589,11 +547,6 @@ const submitPassword = async () => {
// λκΈ μμ (λΉλ°λ²νΈ νμΈ ν)
const submitCommentPassword = async (comment, password) => {
- console.log('μΌμΌμΌ')
-
- console.log("λΉλ°λ²νΈ :", password);
- console.log("λκΈ ID:", comment.commentId);
-
if (!password) {
passwordCommentAlert.value = "λΉλ°λ²νΈλ₯Ό μ
λ ₯ν΄μ£ΌμΈμ.";
return;
@@ -602,12 +555,10 @@ const submitCommentPassword = async (comment, password) => {
const targetComment = findCommentById(comment.commentId, comments.value);
try {
- // console.log('μλ²λ‘ λΉλ°λ²νΈ νμΈ μμ²')
const response = await axios.post(`board/comment/${comment.commentId}/password`, {
LOCCMTPWD: password,
LOCCMTSEQ: comment.commentId,
});
- console.log("β
μλ² μλ΅ λ°μ΄ν°:", response.data);
if (response.data.code === 200 && response.data.data === true) {
passwordCommentAlert.value = "";
@@ -622,9 +573,6 @@ const submitCommentPassword = async (comment, password) => {
} else {
alert("μμ μ·¨μλ₯Ό μ€ν¨νμ΅λλ€.");
}
-
- // μ¬κΈ°λΆλΆμ΄ μ΅λͺ
μμ λΉλ°λ²νΈ λΆλΆμ!!!!!
-
} else if (lastCommentClickedButton.value === "delete") {
passwordCommentAlert.value = "";
@@ -632,14 +580,12 @@ const submitCommentPassword = async (comment, password) => {
}
lastCommentClickedButton.value = null;
} else {
- // console.log("β λΉλ°λ²νΈκ° νλ¦Ό");
passwordCommentAlert.value = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€.";
}
} catch (error) {
- // console.log("π¨ μλ² μμ² μ€ μ€λ₯ λ°μ:", error.response?.data || error);
- // if (error.response?.status === 401) {
- // console.log("β 401 μ€λ₯: μΈμ¦ μ€ν¨ (λΉλ°λ²νΈ λΆμΌμΉ)");
- // }
+ if (error.response?.status === 401) {
+ passwordCommentAlert.value = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€";
+ }
passwordCommentAlert.value = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€";
}
};
@@ -677,17 +623,12 @@ const deleteReplyComment = async (comment) => {
data: { LOCCMTSEQ: comment.commentId }
});
- // console.log("μλ² μλ΅:", response.data);
-
if (response.data.code === 200) {
- // console.log("λκΈ μμ μ±κ³΅!");
await fetchComments();
} else {
- // console.log("λκΈ μμ μ€ν¨:", response.data.message);
alert("λκΈ μμ μ μ€ν¨νμ΅λλ€.");
}
} catch (error) {
- // console.log("λκΈ μμ μ€ μ€λ₯ λ°μ:", error);
alert("λκΈ μμ μ€ μ€λ₯κ° λ°μνμ΅λλ€.");
}
};
@@ -700,9 +641,6 @@ const handleSubmitEdit = async (comment, editedContent) => {
LOCCMTRPY: editedContent
});
- // μμ μ±κ³΅ μ μ
λ°μ΄νΈ
- // comment.content = editedContent;
- // comment.isEditTextarea = false; f
if (response.status === 200) {
const targetComment = findCommentById(comment.commentId, comments.value);
@@ -710,15 +648,12 @@ const handleSubmitEdit = async (comment, editedContent) => {
targetComment.content = editedContent; // λκΈ λ΄μ© μ
λ°μ΄νΈ
targetComment.isEditTextarea = false; // μμ λͺ¨λ λ«κΈ°
} else {
- // console.warn("β μμ ν λκΈμ μ°Ύμ μ μμ");
alert("μμ ν λκΈμ μ°Ύμ μ μμ΅λλ€.");
}
} else {
- // console.log("β λκΈ μμ μ€ν¨:", response.data);
alert("λκΈ μμ μ€ν¨νμ΅λλ€.");
}
} catch (error) {
- // console.error("λκΈ μμ μ€ μ€λ₯ λ°μ:", error);
alert("λκΈ μμ μ€ μ€λ₯ λ°μνμ΅λλ€.");
}
};
@@ -728,10 +663,8 @@ const handleCancelEdit = (comment) => {
const targetComment = findCommentById(comment.commentId, comments.value);
if (targetComment) {
- // console.log("β
μλ³Έ λ°μ΄ν° μ°Ύμ, μμ μ·¨μ μ²λ¦¬ κ°λ₯:", targetComment);
targetComment.isEditTextarea = false;
} else {
- // console.error("β μλ³Έ λ°μ΄ν° μ°Ύμ μ μμ, μμ μ·¨μ μ€ν¨");
alert("μμ μ·¨μλ₯Ό μ€ν¨νμ΅λλ€.");
}
};
@@ -754,7 +687,7 @@ const handleCommentDeleted = (deletedCommentId) => {
return;
}
- // 2λλκΈ μμ
+ // λλκΈ μμ
for (let parent of comments.value) {
const childIndex = parent.children.findIndex(child => child.commentId === deletedCommentId);
if (childIndex !== -1) {
@@ -762,11 +695,8 @@ const handleCommentDeleted = (deletedCommentId) => {
return;
}
}
-
- // console.error("β μμ ν λκΈμ μ°Ύμ μ μμ:", deletedCommentId);
};
-
// λ μ§
const formattedDate = (dateString) => {
if (!dateString) return "λ μ§ μμ";