From 8b8c9f86fd59094beace0e053f2ef5b69fd6af0c Mon Sep 17 00:00:00 2001 From: yoon Date: Thu, 27 Feb 2025 14:57:36 +0900 Subject: [PATCH 01/52] =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B2=B4=ED=81=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/FindPassword.vue | 31 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/user/FindPassword.vue b/src/components/user/FindPassword.vue index 0260908..09866eb 100644 --- a/src/components/user/FindPassword.vue +++ b/src/components/user/FindPassword.vue @@ -68,20 +68,21 @@ :is-alert="passwordcheckAlert" @update:data="passwordcheck = $event" @update:alert="passwordcheckAlert = $event" - @blur="checkPw" + @input="checkPw" :value="passwordcheck" /> {{ passwordcheckError }} -
- -

{{ pwErrMsg }}

+
+ +
+

{{ pwErrMsg }}

From 3f81b571425073c0455baba8f3be452e16d3c197 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Thu, 27 Feb 2025 16:21:51 +0900 Subject: [PATCH 02/52] =?UTF-8?q?=ED=83=91=EB=B0=94=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=ED=95=84=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20url=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- .env.mine | 2 +- src/layouts/TheTop.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.dev b/.env.dev index 5702020..eb6bd0f 100644 --- a/.env.dev +++ b/.env.dev @@ -1,6 +1,6 @@ VITE_DOMAIN = https://192.168.0.251:5173/ # VITE_LOGIN_URL = http://localhost:10325/ms/ -# VITE_FILE_URL = http://localhost:10325/ms/ +VITE_SERVER = httpS://192.168.0.251:10325/ VITE_API_URL = https://192.168.0.251:10325/api/ VITE_TEST_URL = https://192.168.0.251:10325/test/ VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492 \ No newline at end of file diff --git a/.env.mine b/.env.mine index 6f5a98c..07aa984 100644 --- a/.env.mine +++ b/.env.mine @@ -1,6 +1,6 @@ VITE_DOMAIN = http://localhost:5173/ # VITE_LOGIN_URL = http://localhost:10325/ms/ -# VITE_FILE_URL = http://localhost:10325/ms/ +VITE_SERVER = http://localhost:10325/ VITE_API_URL = http://localhost:10325/api/ VITE_TEST_URL = http://localhost:10325/test/ VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492 \ No newline at end of file diff --git a/src/layouts/TheTop.vue b/src/layouts/TheTop.vue index 9bd7296..ada3701 100644 --- a/src/layouts/TheTop.vue +++ b/src/layouts/TheTop.vue @@ -241,7 +241,7 @@ const user = ref(null); //const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ''); - const baseUrl = import.meta.env.BASE_URL; + const baseUrl = import.meta.env.VITE_SERVER; const authStore = useAuthStore(); const userStore = useUserInfoStore(); From b02d99e4b17ab0ea00221e5a5107763b6f3d7835 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Thu, 27 Feb 2025 16:23:45 +0900 Subject: [PATCH 03/52] =?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=9D=B5=EB=AA=85?= =?UTF-8?q?=20=EC=B2=B4=ED=81=AC=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardCommentArea.vue | 7 +++---- src/views/board/BoardView.vue | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index 4f2fca2..e696680 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -51,10 +51,7 @@
- +
@@ -63,6 +60,7 @@ diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue index 3ee4624..3c315a8 100644 --- a/src/components/board/BoardCommentList.vue +++ b/src/components/board/BoardCommentList.vue @@ -78,7 +78,11 @@ const submitPassword = (comment, password) => { }; const handleEditClick = (comment) => { - emit('editClick', comment); + if (comment.parentId) { + emit('deleteClick', comment); // 대댓글 + } else { + emit('deleteClick', comment); // 댓글 + } }; const handleSubmitEdit = (comment, editedContent) => { diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 5a6caf8..725dd2a 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -482,7 +482,6 @@ const findCommentById = (commentId, commentsList) => { // 댓글 수정 버튼 클릭 const editComment = (comment) => { - // 부모 또는 대댓글을 찾아서 가져오기 const targetComment = findCommentById(comment.commentId, comments.value); @@ -590,9 +589,10 @@ const submitPassword = async () => { // 댓글 삭제 (비밀번호 확인 후) const submitCommentPassword = async (comment, password) => { + console.log('야야야') - // console.log("비밀번호 :", password); - // console.log("댓글 ID:", comment.commentId); + console.log("비밀번호 :", password); + console.log("댓글 ID:", comment.commentId); if (!password) { passwordCommentAlert.value = "비밀번호를 입력해주세요."; @@ -607,7 +607,7 @@ const submitCommentPassword = async (comment, password) => { LOCCMTPWD: password, LOCCMTSEQ: comment.commentId, }); - // console.log("✅ 서버 응답 데이터:", response.data); + console.log("✅ 서버 응답 데이터:", response.data); if (response.data.code === 200 && response.data.data === true) { passwordCommentAlert.value = ""; @@ -671,7 +671,6 @@ const deletePost = async () => { // 댓글 삭제 (대댓글 포함) const deleteReplyComment = async (comment) => { if (!confirm("정말 이 댓글을 삭제하시겠습니까?")) return; - console.log("댓글 수정, 대댓글도?"); try { const response = await axios.delete(`board/comment/${comment.commentId}`, { From 0859ad72d06cd7ee84f60421ef97656960b3e291 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Fri, 28 Feb 2025 09:27:34 +0900 Subject: [PATCH 07/52] =?UTF-8?q?=EB=A9=94=EB=89=B4=20js=20=EC=9B=90?= =?UTF-8?q?=EB=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/main.js | 7 ------- src/layouts/NormalLayout.vue | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index c118e86..047566f 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -7,12 +7,6 @@ //----------------- let menu, animate; -<<<<<<< HEAD -var menu, animate; -(function () { - // Initialize menu - //----------------- -======= let layoutMenuEl = document.querySelectorAll('#layout-menu'); layoutMenuEl.forEach(function (element) { menu = new Menu(element, { @@ -23,7 +17,6 @@ var menu, animate; window.Helpers.scrollToActive((animate = false)); window.Helpers.mainMenu = menu; }); ->>>>>>> board-comment // Initialize menu togglers and bind click on each let menuToggler = document.querySelectorAll('.layout-menu-toggle'); diff --git a/src/layouts/NormalLayout.vue b/src/layouts/NormalLayout.vue index 0277f84..08cef90 100644 --- a/src/layouts/NormalLayout.vue +++ b/src/layouts/NormalLayout.vue @@ -32,17 +32,17 @@ window.isDarkStyle = window.Helpers.isDarkStyle(); -const loadScript = src => { - const script = document.createElement('script'); - script.src = src; - script.type = 'text/javascript'; - script.async = true; - document.body.appendChild(script); -}; -nextTick(async () => { - await wait(200); - loadScript('/vendor/js/menu.js'); - // loadScript('/js/main.js'); -}); + const loadScript = src => { + const script = document.createElement('script'); + script.src = src; + script.type = 'text/javascript'; + script.async = true; + document.body.appendChild(script); + }; + nextTick(async () => { + await wait(200); + loadScript('/vendor/js/menu.js'); + loadScript('/js/main.js'); + }); From d1c91b30df144b11908e8671db45e8bff186a568 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 28 Feb 2025 10:01:53 +0900 Subject: [PATCH 08/52] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardComment.vue | 1 - src/components/board/BoardProfile.vue | 7 ++- src/views/board/BoardList.vue | 5 +- src/views/board/BoardView.vue | 86 +++------------------------ 4 files changed, 15 insertions(+), 84 deletions(-) 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 @@
Avatar
+
{{ 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 "날짜 없음"; From 2cc280717d1d5638f066dca8d6a7f42c087eae39 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 28 Feb 2025 10:09:45 +0900 Subject: [PATCH 09/52] . --- src/views/board/BoardView.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 30d7921..cfacd8f 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -461,6 +461,7 @@ const editComment = (comment) => { if (isMyComment) { targetComment.isEditTextarea = !targetComment.isEditTextarea; + lastCommentClickedButton.value = "edit"; } else if (isAnonymous) { toggleCommentPassword(comment, "edit"); } else { @@ -616,6 +617,7 @@ const deletePost = async () => { // 댓글 삭제 (대댓글 포함) const deleteReplyComment = async (comment) => { + console.log('지금 여기') if (!confirm("정말 이 댓글을 삭제하시겠습니까?")) return; try { @@ -635,6 +637,7 @@ const deleteReplyComment = async (comment) => { // 댓글 수정 확인 const handleSubmitEdit = async (comment, editedContent) => { + console.log('asdasdasdasd') try { const response = await axios.put(`board/comment/${comment.commentId}`, { LOCCMTSEQ: comment.commentId, From 86f85cce102305890c144352f3857f0d2228e080 Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Feb 2025 10:13:23 +0900 Subject: [PATCH 10/52] =?UTF-8?q?=ED=99=9C=EC=84=B1=ED=99=94=20=EB=90=9C?= =?UTF-8?q?=20=EC=9C=A0=EC=A0=80=20=EC=95=9E=EC=9C=BC=EB=A1=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/UserList.vue | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/components/user/UserList.vue b/src/components/user/UserList.vue index 27f81e6..f921ce3 100644 --- a/src/components/user/UserList.vue +++ b/src/components/user/UserList.vue @@ -1,7 +1,7 @@ \ No newline at end of file + + +const selected = computed(() => { + const selectedItem = props.data.find(item => + props.isCommon ? item.value === selectData.value : props.data.indexOf(item) === selectData.value + ); + return selectedItem ? selectedItem.label : null; +}); + + diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue index 2953ea3..5a5b557 100644 --- a/src/components/user/RegisterForm.vue +++ b/src/components/user/RegisterForm.vue @@ -92,6 +92,7 @@ :is-row="false" :is-label="true" :is-common="true" + :is-color="true" :data="colorList" @update:data="color = $event" class="w-50" @@ -118,6 +119,7 @@ :is-row="false" :is-label="true" :is-common="true" + :is-mbti="true" :data="mbtiList" @update:data="mbti = $event" class="w-50" From a9d4f675636607c836054a897c02453964d2e4ff Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Feb 2025 13:40:16 +0900 Subject: [PATCH 22/52] Merge branch 'main' into login From 6bff0e9ede53baac9e3c03c19b3741a5fc330b44 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 28 Feb 2025 13:56:51 +0900 Subject: [PATCH 23/52] =?UTF-8?q?=EA=B8=80=EC=93=B0=EA=B8=B0=20=EA=B3=B5?= =?UTF-8?q?=EB=B0=B1=EC=B2=98=EB=A6=AC=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardWrite.vue | 82 +++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/src/views/board/BoardWrite.vue b/src/views/board/BoardWrite.vue index b337d6c..45d2657 100644 --- a/src/views/board/BoardWrite.vue +++ b/src/views/board/BoardWrite.vue @@ -9,12 +9,15 @@
+ @@ -32,16 +35,19 @@ :id="`category-${index}`" :value="category.CMNCODVAL" v-model="categoryValue" + @change="categoryAlert = false" />
-
카테고리를 선택해주세요.
+
+ 카테고리를 선택해주세요. +
- +
@@ -61,14 +69,16 @@ @update:isValid="isFileValid = $event" /> +
-
@@ -115,10 +125,9 @@ const fetchCategories = async () => { try { const response = await axios.get('board/categories'); categoryList.value = response.data.data; - // "자유" 카테고리 찾기 (CMNCODNAM이 '자유'인 것 선택) const freeCategory = categoryList.value.find(category => category.CMNCODNAM === '자유'); if (freeCategory) { - categoryValue.value = freeCategory.CMNCODVAL; // 기본 선택값 설정 + categoryValue.value = freeCategory.CMNCODVAL; } } catch (error) { console.error('카테고리 불러오기 오류:', error); @@ -129,15 +138,44 @@ onMounted(() => { fetchCategories(); }); +// 제목 유효성 검사: 공백만 입력하면 경고 유지, 문자 포함 시 정상 +const validateTitle = () => { + titleAlert.value = title.value.trim().length === 0; +}; + +// 비밀번호 유효성 검사: 공백 입력 방지 +const validatePassword = () => { + password.value = password.value.replace(/\s/g, ""); // 공백 제거 + passwordAlert.value = password.value.length === 0; +}; + +// 에디터에서 업데이트된 데이터를 반영하는 함수 +const updateContent = (data) => { + let rawText = ''; + + if (typeof data === 'object' && data.ops) { + rawText = data.ops.map(op => (typeof op.insert === 'string' ? op.insert : '')).join('').trim(); + } else if (typeof data === 'string') { + rawText = data.replace(/(<([^>]+)>)/gi, "").trim(); + } else { + rawText = ''; + } + + content.value = rawText.length > 0 ? data : ""; + contentAlert.value = rawText.length === 0; +}; + +/** 페이지 이동 (목록으로 이동) */ const goList = () => { router.push('/board'); }; const write = async () => { - titleAlert.value = !title.value; - passwordAlert.value = categoryValue.value === 300102 && !password.value; - contentAlert.value = !content.value; + validateTitle(); + validatePassword(); + categoryAlert.value = !categoryValue.value; + contentAlert.value = content.value.length === 0; if (titleAlert.value || passwordAlert.value || contentAlert.value || categoryAlert.value || !isFileValid.value) { return; @@ -154,26 +192,6 @@ const write = async () => { const { data: boardResponse } = await axios.post('board', boardData); const boardId = boardResponse.data; - if (attachFiles.value && attachFiles.value.length > 0) { - for (const file of attachFiles.value) { - const formData = new FormData(); - const fileNameWithoutExt = file.name.replace(/\.[^/.]+$/, ''); - - formData.append('CMNBRDSEQ', boardId); - formData.append('CMNFLEORG', fileNameWithoutExt); - formData.append('CMNFLEEXT', file.name.split('.').pop()); - formData.append('CMNFLESIZ', file.size); - formData.append('CMNFLEPAT', 'boardfile'); - formData.append('file', file); - - await axios.post(`board/${boardId}/attachments`, formData, { - headers: { - 'Content-Type': 'multipart/form-data', - }, - }); - } - } - toastStore.onToast('게시물이 작성되었습니다.', 's'); goList(); } catch (error) { From 2d47d1926aef570d310ee40e977c570c9c25828e Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 28 Feb 2025 13:57:42 +0900 Subject: [PATCH 24/52] Merge branch 'main' into board-write From af3316fc603bcafe9c982d59e04fc9bef03fd4f4 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 28 Feb 2025 13:58:33 +0900 Subject: [PATCH 25/52] Merge branch 'board-write' From 64cb7e30c1965978e0d292e57b254a93ba0f6321 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Fri, 28 Feb 2025 13:59:49 +0900 Subject: [PATCH 26/52] =?UTF-8?q?=EB=8C=80=EB=8C=93=EA=B8=80=20=EB=82=B4?= =?UTF-8?q?=EC=9A=A9=EC=97=86=EC=9D=84=EB=95=8C=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EC=95=88=EB=90=98=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/common.js | 8 ++ src/components/board/BoardCommentArea.vue | 104 +++++++++++----------- 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/common/common.js b/src/common/common.js index d1e4b91..9acd369 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -73,6 +73,14 @@ const common = { seconds: zeroFormat(date.getSeconds()), }; }, + + isNotEmpty(obj) { + if (obj === null || obj === undefined) return false; + if (typeof obj === 'string' && obj.trim() === '') return false; + if ((Array.isArray(obj) || obj === Object(obj)) && Object.keys(obj).length === 0) return false; + + return true; + }, }; export default { diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index ed153ab..6cf3f00 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -11,13 +11,9 @@ -->
- + {{ commentAlert }} + {{ textAlert }}
@@ -26,12 +22,7 @@
- +
@@ -59,49 +50,58 @@ From ea7735839faaec2a461325adbbba1b9e5b162e8e Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Feb 2025 14:05:27 +0900 Subject: [PATCH 27/52] =?UTF-8?q?@input=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/FormInput.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/input/FormInput.vue b/src/components/input/FormInput.vue index a51c16c..d1ad6fd 100644 --- a/src/components/input/FormInput.vue +++ b/src/components/input/FormInput.vue @@ -15,6 +15,7 @@ :disabled="disabled" :min="min" @focusout="$emit('focusout', modelValue)" + @input="handleInput" />
{{ title }}을 확인해주세요. @@ -92,11 +93,6 @@ const inputValue = ref(props.modelValue); // 부모로 데이터 업데이트 watch(inputValue, (newValue) => { emits('update:modelValue', newValue); - - // 값이 입력될 때 `alert`를 false로 설정 - if (newValue.trim() !== '') { - emits('update:alert', false); - } }); // 초기값 동기화 @@ -106,6 +102,13 @@ watch(() => props.modelValue, (newValue) => { } }); +const handleInput = (event) => { + const newValue = event.target.value.slice(0, props.maxlength); + + if (newValue.trim() !== '') { + emits('update:alert', false); + } +}; From 469688b2d09ac5757ab2d3190b879ef1b839e97a Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Feb 2025 14:09:13 +0900 Subject: [PATCH 28/52] =?UTF-8?q?=EC=A7=80=EB=8F=84=20=ED=9C=A0=20?= =?UTF-8?q?=EC=95=88=EB=8F=BC=EB=8A=94=EA=B1=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/list/ProjectCard.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/list/ProjectCard.vue b/src/components/list/ProjectCard.vue index 272c0f4..7af8059 100644 --- a/src/components/list/ProjectCard.vue +++ b/src/components/list/ProjectCard.vue @@ -38,7 +38,7 @@
{{ address }} {{ addressdtail }} -
+
@@ -46,8 +46,7 @@ v-if="coordinates" :lat="coordinates.lat" :lng="coordinates.lng" - :draggable="false" - class="w-100 h-px-200" + class="w-px-200 h-px-200" > Date: Fri, 28 Feb 2025 14:09:27 +0900 Subject: [PATCH 29/52] =?UTF-8?q?=EC=83=89=EC=83=81=20=EB=AF=B8=EB=A6=AC?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/projectlist/ProjectList.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/projectlist/ProjectList.vue b/src/components/projectlist/ProjectList.vue index 7df7b41..0ebed53 100644 --- a/src/components/projectlist/ProjectList.vue +++ b/src/components/projectlist/ProjectList.vue @@ -49,6 +49,7 @@ :is-essential="true" :is-label="true" :is-common="true" + :is-color="true" :data="colorList" @update:data="color = $event" /> From 86a6e5b27b18f663f31b3c4f736444b8954885d1 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 28 Feb 2025 14:12:33 +0900 Subject: [PATCH 30/52] =?UTF-8?q?=EC=88=98=EC=A0=95=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EB=88=84=EB=A5=B4=EB=A9=B4=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardView.vue | 40 ++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 08411aa..eaa6dd5 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -473,16 +473,44 @@ const editComment = (comment) => { const isAnonymous = comment.author === "익명"; if (isMyComment) { - targetComment.isEditTextarea = !targetComment.isEditTextarea; - lastCommentClickedButton.value = "edit"; + if (targetComment.isEditTextarea) { + // 수정창이 열려 있는 상태에서 다시 수정 버튼을 누르면 초기화 + targetComment.isEditTextarea = false; + currentPasswordCommentId.value = comment.commentId; + } else { + // 다른 모든 댓글의 수정창 닫기 + closeAllEditTextareas(); + + // 현재 댓글만 수정 모드 활성화 + targetComment.isEditTextarea = true; + } } else if (isAnonymous) { - if (targetComment.isEditTextarea) return; - toggleCommentPassword(comment, "edit"); + if (currentPasswordCommentId.value === comment.commentId) { + // 이미 비밀번호 입력 중이면 유지 + return; + } else { + // 다른 모든 댓글의 수정창 닫기 + closeAllEditTextareas(); + + // 비밀번호 입력 + targetComment.isEditTextarea = false; + toggleCommentPassword(comment, "edit"); + } } else { alert("수정이 불가능합니다"); } } +// 모든 댓글의 수정 창 닫기 +const closeAllEditTextareas = () => { + comments.value.forEach(comment => { + comment.isEditTextarea = false; + comment.children.forEach(reply => { + reply.isEditTextarea = false; + }); + }); +}; + // 댓글 삭제 버튼 클릭 const deleteComment = async (comment) => { const isMyComment = comment.authorId === currentUserId.value; @@ -587,7 +615,9 @@ const submitCommentPassword = async (comment, password) => { if (lastCommentClickedButton.value === "edit") { if (targetComment) { - //여기서 input 창 닫혀야함 + // 다른 모든 댓글의 수정 창 닫기 + closeAllEditTextareas(); + targetComment.isEditTextarea = true; passwordCommentAlert.value = ""; currentPasswordCommentId.value = null; From 2a55574646b6da35906c49a44b504129ed2f2a3d Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Fri, 28 Feb 2025 14:30:19 +0900 Subject: [PATCH 31/52] =?UTF-8?q?=EB=8C=80=EB=8C=93=EA=B8=80=20=EC=9D=B5?= =?UTF-8?q?=EB=AA=85=EC=9D=BC=EB=95=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardCommentArea.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index 6cf3f00..29b7267 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -37,6 +37,7 @@ placeholder="비밀번호 입력" /> {{ passwordAlert }} + {{ passwordAlert2 }}
@@ -76,6 +77,7 @@ const password = ref(''); const isCheck = ref(props.unknown); const textAlert = ref(''); + const passwordAlert2 = ref(''); const emit = defineEmits(['submitComment']); const LOCBRDTYP = isCheck.value ? '300102' : null; @@ -86,6 +88,12 @@ } else { textAlert.value = ''; } + if (isCheck.value && !$common.isNotEmpty(password.value)) { + passwordAlert2.value = '비밀번호를 입력하세요'; + return false; + } else { + passwordAlert2.value = ''; + } emit('submitComment', { comment: comment.value, From e63f9498bd9d2bb54646dd12a60991ae2e4173fb Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 28 Feb 2025 14:31:36 +0900 Subject: [PATCH 32/52] =?UTF-8?q?isDeleted=20=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardComment.vue | 17 ++++++++++++++++- src/components/board/BoardCommentList.vue | 5 +++++ src/views/board/BoardView.vue | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 205d5a6..616e583 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -37,6 +37,11 @@
+ + + @@ -109,6 +114,10 @@ const props = defineProps({ type: Boolean, default: false }, + isDeleted: { + type: Boolean, + default: false + }, isCommentPassword: { type: Boolean, default: false, @@ -154,7 +163,6 @@ const handleUpdateReaction = (reactionData) => { // 비밀번호 확인 const logPasswordAndEmit = () => { - console.log('비밀번호 확인',props.password) emit('submitPassword', props.comment, props.password); }; @@ -164,6 +172,13 @@ watch(() => props.comment.isEditTextarea, (newVal) => { } }); +watch(() => props.comment.isDeleted, () => { + if (newVal) { + localEditedContent.value = "댓글이 삭제되었습니다."; // UI 반영 + props.comment.isEditTextarea = false; + } +}); + // 수정버튼 const submitEdit = () => { emit('submitEdit', props.comment, localEditedContent.value); diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue index 1b47923..a33e464 100644 --- a/src/components/board/BoardCommentList.vue +++ b/src/components/board/BoardCommentList.vue @@ -10,6 +10,7 @@ :comment="comment" :isCommentAuthor="comment.isCommentAuthor" :isEditTextarea="comment.isEditTextarea" + :isDeleted="comment.isDeleted" :isCommentPassword="isCommentPassword" :passwordCommentAlert="passwordCommentAlert || ''" :currentPasswordCommentId="currentPasswordCommentId" @@ -53,6 +54,10 @@ const props = defineProps({ type: Boolean, default: false, }, + isDeleted: { + type: Boolean, + default: false, + }, passwordCommentAlert: { type: String, default: '' diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index eaa6dd5..2f5bb28 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -102,6 +102,7 @@ :comments="commentsWithAuthStatus" :isCommentPassword="isCommentPassword" :isEditTextarea="isEditTextarea" + :isDeleted="isDeleted" :passwordCommentAlert="passwordCommentAlert" :currentPasswordCommentId="currentPasswordCommentId" :password="password" @@ -183,6 +184,7 @@ const currentPasswordCommentId = ref(null); const lastClickedButton = ref(""); const lastCommentClickedButton = ref(""); const isEditTextarea = ref(false); +const isDeleted = ref(true); const commentAlert = ref(''); const updatePassword = (newPassword) => { @@ -671,6 +673,10 @@ const deletePost = async () => { const deleteReplyComment = async (comment) => { if (!confirm("정말 이 댓글을 삭제하시겠습니까?")) return; + const targetComment = findCommentById(comment.commentId, comments.value); + + console.log('잘되니?',comment) + try { const response = await axios.delete(`board/comment/${comment.commentId}`, { data: { LOCCMTSEQ: comment.commentId } @@ -678,6 +684,14 @@ const deleteReplyComment = async (comment) => { if (response.data.code === 200) { await fetchComments(); + + if (targetComment) { + console.log('타겟',targetComment) + // ✅ 댓글 내용만 "삭제된 댓글입니다."로 변경하고, 구조는 유지 + targetComment.content = "댓글이 삭제되었습니다."; + targetComment.author = "알 수 없음"; // 익명 처리 + targetComment.isDeleted = true; // ✅ 삭제 상태를 추가 + } } else { alert("댓글 삭제에 실패했습니다."); } From 64a915f0d846fd756b694a0109f9c0bf670bd705 Mon Sep 17 00:00:00 2001 From: Dang Date: Fri, 28 Feb 2025 14:40:57 +0900 Subject: [PATCH 33/52] =?UTF-8?q?=EC=9A=A9=EC=96=B4=EC=A7=91=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/button/EditBtn.vue | 33 +++++++--- src/components/button/WriteBtn.vue | 27 +++++++- src/components/projectlist/ProjectList.vue | 2 +- src/components/wordDict/DictCard.vue | 75 ++++------------------ src/components/wordDict/DictWrite.vue | 29 --------- src/views/wordDict/wordDict.vue | 58 ++++------------- 6 files changed, 73 insertions(+), 151 deletions(-) diff --git a/src/components/button/EditBtn.vue b/src/components/button/EditBtn.vue index 9987ddb..d3437b0 100644 --- a/src/components/button/EditBtn.vue +++ b/src/components/button/EditBtn.vue @@ -1,13 +1,30 @@ - diff --git a/src/components/button/WriteBtn.vue b/src/components/button/WriteBtn.vue index 41b56c9..0bc6ef9 100644 --- a/src/components/button/WriteBtn.vue +++ b/src/components/button/WriteBtn.vue @@ -1,9 +1,30 @@ +const props = defineProps({ + isToggleEnabled: { + type: Boolean, + default: false, + }, +}); + +const buttonClass = ref("bx bx-edit"); + +const toggleText = () => { + if (props.isToggleEnabled) { + buttonClass.value = buttonClass.value === "bx bx-edit" ? "bx bx-x" : "bx bx-edit"; + } +}; + +const resetButton = () => { + buttonClass.value = "bx bx-edit"; +}; + +defineExpose({ resetButton }); + \ No newline at end of file diff --git a/src/components/projectlist/ProjectList.vue b/src/components/projectlist/ProjectList.vue index 7df7b41..dfbb7c3 100644 --- a/src/components/projectlist/ProjectList.vue +++ b/src/components/projectlist/ProjectList.vue @@ -100,7 +100,7 @@ import { computed, ref, watch, onMounted, inject } from 'vue'; import SearchBar from '@c/search/SearchBar.vue'; import ProjectCard from '@c/list/ProjectCard.vue'; - import CategoryBtn from '@c/category/CategoryBtn.vue'; + import CategoryBtn from '@/components/category/CategoryBtn.vue'; import WriteBtn from '@c/button/WriteBtn.vue'; import CenterModal from '@c/modal/CenterModal.vue'; import FormSelect from '@c/input/FormSelect.vue'; diff --git a/src/components/wordDict/DictCard.vue b/src/components/wordDict/DictCard.vue index 94b6deb..392a544 100644 --- a/src/components/wordDict/DictCard.vue +++ b/src/components/wordDict/DictCard.vue @@ -18,7 +18,6 @@ type="checkbox" class="form-check-input admin-chk" :name="item.WRDDICSEQ" - id="" @change="toggleCheck($event)" >
@@ -66,7 +65,7 @@
- +
@@ -74,7 +73,7 @@ diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 3ac8ef0..791669e 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -18,8 +18,8 @@ - - @@ -59,6 +59,7 @@ 공지 📌 {{ notice.title }} + [ {{ notice.commentCount }} ] N @@ -76,6 +77,7 @@ {{ post.id }} {{ post.title }} + [ {{ post.commentCount }} ] N @@ -196,7 +198,6 @@ const fetchGeneralPosts = async (page = 1) => { if (data?.data) { const totalPosts = data.data.total; - generalList.value = data.data.list.map((post, index) => ({ realId: post.id, id: totalPosts - ((page - 1) * selectedSize.value) - index, @@ -206,7 +207,8 @@ const fetchGeneralPosts = async (page = 1) => { date: formatDate(post.date), // 날짜 변환 적용 views: post.cnt || 0, hasAttachment: post.hasAttachment || false, - img: post.firstImageUrl || null + img: post.firstImageUrl || null, + commentCount : post.commentCount })); pagination.value = { @@ -246,7 +248,8 @@ const fetchNoticePosts = async () => { rawDate: post.date, views: post.cnt || 0, hasAttachment: post.hasAttachment || false, - img: post.firstImageUrl || null + img: post.firstImageUrl || null, + commentCount : post.commentCount })); } } catch (error) { @@ -286,4 +289,12 @@ onMounted(() => { width: 100% !important; } } + /* 댓글 개수 스타일 */ +.comment-count { + font-size: 0.9rem; /* 글씨 크기 증가 */ + font-weight: bold; + color: #ff5733; /* 강조 색상 (붉은 계열) */ + border-radius: 4px; /* 둥근 모서리 */ + padding: 2px 6px; /* 내부 패딩 */ +} From 58647b225caba5add6e2848c91e81eb280795b2d Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Tue, 4 Mar 2025 12:51:32 +0900 Subject: [PATCH 46/52] =?UTF-8?q?=EC=A0=A0=ED=82=A8=EC=8A=A4=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jenkinsfile b/jenkinsfile index 2ece8aa..d554d83 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -30,9 +30,10 @@ pipeline { steps { // 로컬 Nginx 서버 재실행 bat ''' - taskkill /f /im nginx.exe > nul 2>&1 - ping -n 3 127.0.0.1 > nul - start "" "C:\\nginx\\nginx.exe" + net stop localnginx + ping -n 5 127.0.0.1 > nul + net start localnginx + ping -n 5 127.0.0.1 > nul ''' } } From af63fd12b67a30020c474d7ef138c6510dec06d0 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Tue, 4 Mar 2025 13:24:24 +0900 Subject: [PATCH 47/52] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.dev b/.env.dev index b3fdefe..4da29f6 100644 --- a/.env.dev +++ b/.env.dev @@ -1,6 +1,6 @@ VITE_DOMAIN = https://192.168.0.251:5173/ # VITE_LOGIN_URL = http://localhost:10325/ms/ -VITE_SERVER = httpS://192.168.0.251:10300/ +VITE_SERVER = https://192.168.0.251:10300/ VITE_API_URL = https://192.168.0.251:10300/api/ VITE_TEST_URL = https://192.168.0.251:10300/test/ VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492 \ No newline at end of file From 3ba4718e0a4214d600c7ab9b574280cf54ecc5d4 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Tue, 4 Mar 2025 13:52:25 +0900 Subject: [PATCH 48/52] =?UTF-8?q?=EB=A9=94=EB=89=B4=EB=B0=94=20pc=20?= =?UTF-8?q?=EA=B3=A0=EC=A0=95=20=EB=B0=8F=20=ED=86=A0=EA=B8=80=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 3 +-- public/js/main.js | 4 +++- src/layouts/TheMenu.vue | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 3a0ef47..95cc0cd 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,6 @@ - @@ -77,7 +76,7 @@ - + themeConfig diff --git a/public/js/main.js b/public/js/main.js index 047566f..102f787 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -111,5 +111,7 @@ // If current layout is vertical and current window screen is > small // Auto update menu collapsed/expanded based on the themeConfig - window.Helpers.setCollapsed(true, false); + // 250304 pc 화면에서 메뉴바 고정을 위해 false 처리 + window.Helpers.setCollapsed(false, false); + //window.Helpers.setCollapsed(true, false); })(); diff --git a/src/layouts/TheMenu.vue b/src/layouts/TheMenu.vue index f82dba7..6c5c44c 100644 --- a/src/layouts/TheMenu.vue +++ b/src/layouts/TheMenu.vue @@ -23,9 +23,10 @@ LOCALNET - + +
From fbd345403a8a0b86d70e327c832411c2bbbec35f Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Tue, 4 Mar 2025 13:53:25 +0900 Subject: [PATCH 49/52] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 95cc0cd..3859f38 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,7 @@ - themeConfig + From 27c9392d68531b0977d77c8fa4fb58c70eb6d617 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 4 Mar 2025 16:37:49 +0900 Subject: [PATCH 50/52] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardCommentArea.vue | 2 +- src/views/board/BoardList.vue | 8 +-- src/views/board/BoardView.vue | 69 +++++++++------------ src/views/board/BoardWrite.vue | 74 +++++++++++++++++------ 4 files changed, 89 insertions(+), 64 deletions(-) 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 }}

+ +
    +
  • + {{ file.name }} + +
  • +
+
- Avatar + Avatar
- +
{{ profileName }}
@@ -23,8 +23,7 @@
- - - - diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index 3719d7b..d268bb6 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -39,8 +39,8 @@
  • {{ attachment.originalName }}.{{ attachment.extension }} @@ -157,8 +157,26 @@ const commentsWithAuthStatus = computed(() => { const attachments = ref([]); // 첨부파일 다운로드 URL 생성 -const getFileDownloadUrl = (attachment) => { - return `board/files/download?path=${encodeURIComponent(attachment.path)}`; +const downloadFile = async (attachment) => { + try { + const response = await axios.get(`board/download`, { + params: { path: attachment.path }, + responseType: 'blob' + }); + + // Blob에서 파일 다운로드 링크 생성 + const url = window.URL.createObjectURL(new Blob([response.data])); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', attachment.originalName + '.' + attachment.extension); + document.body.appendChild(link); + link.click(); + link.remove(); + window.URL.revokeObjectURL(url); + } catch (error) { + console.error('파일 다운로드 오류:', error); + alert('파일 다운로드 중 오류가 발생했습니다.'); + } }; @@ -200,14 +218,11 @@ 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 || {}; profileName.value = data.author || '익명'; - authorId.value = data.authorId; //게시글 작성자 id + authorId.value = data.authorId; boardTitle.value = data.title || '제목 없음'; boardContent.value = data.content || ''; date.value = data.date || ''; @@ -277,7 +292,6 @@ const fetchComments = async (page = 1) => { page } }); - const commentsList = response.data.data.list.map(comment => ({ commentId: comment.LOCCMTSEQ, // 댓글 ID boardId: comment.LOCBRDSEQ, @@ -292,6 +306,7 @@ const fetchComments = async (page = 1) => { createdAtRaw: new Date(comment.LOCCMTRDT), // 정렬용 createdAt: formattedDate(comment.LOCCMTRDT), // 표시용 children: [], // 대댓글을 담을 배열 + updateAtRaw: new Date(comment.LOCCMTUDT), })); commentsList.sort((a, b) => b.createdAtRaw - a.createdAtRaw); From 5ae3d3bc758cd8386f93f1c0f78c3c49b8f2692f Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Thu, 6 Mar 2025 09:47:37 +0900 Subject: [PATCH 52/52] =?UTF-8?q?=EA=B2=8C=EC=8B=9C=ED=8C=90=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EB=90=9C=20=EB=8C=93=EA=B8=80=20=EC=95=88=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardView.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index d268bb6..84bb8b2 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -306,7 +306,8 @@ const fetchComments = async (page = 1) => { createdAtRaw: new Date(comment.LOCCMTRDT), // 정렬용 createdAt: formattedDate(comment.LOCCMTRDT), // 표시용 children: [], // 대댓글을 담을 배열 - updateAtRaw: new Date(comment.LOCCMTUDT), + updateAtRaw: comment.LOCCMTUDT, + })); commentsList.sort((a, b) => b.createdAtRaw - a.createdAtRaw);