diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index 29b7267..3fa251d 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -75,7 +75,7 @@ const $common = inject('common'); const comment = ref(''); const password = ref(''); - const isCheck = ref(props.unknown); + const isCheck = ref(false); const textAlert = ref(''); const passwordAlert2 = ref(''); diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 791669e..0a33b11 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -61,7 +61,7 @@ 📌 {{ notice.title }} [ {{ notice.commentCount }} ] - + N {{ notice.author }} @@ -79,7 +79,7 @@ {{ post.title }} [ {{ post.commentCount }} ] - + N {{ post.author }} @@ -206,7 +206,7 @@ const fetchGeneralPosts = async (page = 1) => { rawDate: post.date, date: formatDate(post.date), // 날짜 변환 적용 views: post.cnt || 0, - hasAttachment: post.hasAttachment || false, + hasAttachment: post.hasAttachment, img: post.firstImageUrl || null, commentCount : post.commentCount })); @@ -247,7 +247,7 @@ const fetchNoticePosts = async () => { date: formatDate(post.date), rawDate: post.date, views: post.cnt || 0, - hasAttachment: post.hasAttachment || false, + hasAttachment: post.hasAttachment, img: post.firstImageUrl || null, commentCount : post.commentCount })); diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 653c54d..3719d7b 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -17,47 +17,35 @@ :isAuthor="isAuthor" @editClick="editClick" @deleteClick="deleteClick" - /> - - -
-
- - -
- {{ passwordAlert }} -
+ /> +
-
{{ boardTitle }}
- -
+ +
- +
@@ -75,15 +63,8 @@ :likeClicked="likeClicked" :dislikeClicked="dislikeClicked" @updateReaction="handleUpdateReaction" - /> + />
- - - { return updatedComments; }); +const attachments = ref([]); +// 첨부파일 다운로드 URL 생성 +const getFileDownloadUrl = (attachment) => { + return `board/files/download?path=${encodeURIComponent(attachment.path)}`; +}; + + const password = ref(''); const passwordAlert = ref(""); @@ -212,7 +200,7 @@ const fetchBoardDetails = async () => { try { const response = await axios.get(`board/${currentBoardId.value}`); const data = response.data.data; - + console.log(data) // API 응답 데이터 반영 // const boardDetail = data.boardDetail || {}; @@ -228,6 +216,7 @@ const fetchBoardDetails = async () => { dislikes.value = data.dislikeCount || 0; attachment.value = data.hasAttachment || null; commentNum.value = data.commentCount || 0; + attachments.value = data.attachments || []; } catch (error) { alert('게시물 데이터를 불러오는 중 오류가 발생했습니다.'); @@ -461,10 +450,10 @@ const findCommentById = (commentId, commentsList) => { // 댓글 수정(대댓글 포함) const editComment = (comment) => { - password.value = ''; - passwordCommentAlert.value = ''; + password.value = ''; + passwordCommentAlert.value = ''; currentPasswordCommentId.value = null; - + const targetComment = findCommentById(comment.commentId, comments.value); if (!targetComment) { @@ -493,7 +482,7 @@ const editComment = (comment) => { } else { // 다른 모든 댓글의 수정창 닫기 closeAllEditTextareas(); - + // 비밀번호 입력 targetComment.isEditTextarea = false; toggleCommentPassword(comment, "edit"); @@ -537,7 +526,7 @@ const toggleCommentPassword = (comment, button) => { passwordCommentAlert.value = ''; } else { currentPasswordCommentId.value = comment.commentId; // 비밀번호 창 열기 - password.value = ''; + password.value = ''; passwordCommentAlert.value = ''; } diff --git a/src/views/board/BoardWrite.vue b/src/views/board/BoardWrite.vue index 1bf48cf..d7b4b43 100644 --- a/src/views/board/BoardWrite.vue +++ b/src/views/board/BoardWrite.vue @@ -60,14 +60,26 @@ />
+ + +

첨부파일: {{ fileCount }} / 5개

+

{{ fileError }}

+ + +