diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue
index c7e9220..8dd990e 100644
--- a/src/components/board/BoardComment.vue
+++ b/src/components/board/BoardComment.vue
@@ -16,7 +16,7 @@
@updateReaction="handleUpdateReaction"
/>
-
+
-
+
-
-
+
+
- -
+
-
diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue
index 283ce8b..0c207bb 100644
--- a/src/components/board/BoardCommentArea.vue
+++ b/src/components/board/BoardCommentArea.vue
@@ -11,7 +11,7 @@
-->
-
+
{{ commentAlert }}
{{ textAlert }}
@@ -51,78 +51,81 @@
+ if (isCheck.value && !$common.isNotEmpty(password.value)) {
+ passwordAlert2.value = '비밀번호를 입력하세요';
+ return false;
+ } else {
+ passwordAlert2.value = '';
+ }
+
+ // 댓글 제출
+ emit('submitComment', {
+ comment: comment.value,
+ password: isCheck.value ? password.value : '',
+ isCheck: isCheck.value,
+ LOCBRDTYP: isCheck.value ? '300102' : null, // 익명일 경우 '300102' 설정
+ });
+
+ // 제출 후 입력 필드 리셋
+ resetCommentForm();
+ };
+
+ // 입력 필드 리셋 함수 추가
+ const resetCommentForm = () => {
+ comment.value = '';
+ password.value = '';
+ isCheck.value = false;
+ };
+
+ watch(
+ () => props.passwordAlert,
+ () => {
+ if (!props.passwordAlert) {
+ resetCommentForm();
+ }
+ },
+ );
+
diff --git a/src/components/board/BoardCommentList.vue b/src/components/board/BoardCommentList.vue
index 0987a4c..87da0cd 100644
--- a/src/components/board/BoardCommentList.vue
+++ b/src/components/board/BoardCommentList.vue
@@ -1,17 +1,13 @@
- -
+
-
handleUpdateReaction(reactionData, comment.commentId, comment.boardId)"
+ @updateReaction="reactionData => handleUpdateReaction(reactionData, comment.commentId, comment.boardId)"
@update:password="updatePassword"
/>
@@ -29,96 +25,105 @@
diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue
index 87e08bc..b183865 100644
--- a/src/components/board/BoardProfile.vue
+++ b/src/components/board/BoardProfile.vue
@@ -40,7 +40,7 @@
const defaultProfile = '/img/icons/icon.png';
// 서버의 이미지 경로 (Vue 환경 변수 사용 가능)
- const baseUrl = 'http://localhost:10325/'; // API 서버 URL
+ const baseUrl = import.meta.env.VITE_SERVER; // API 서버 URL
// Props 정의
const props = defineProps({
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index 5015bf6..10d9a31 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -92,6 +92,7 @@
:unknown="unknown"
:commentAlert="commentAlert"
:passwordAlert="passwordAlert"
+ :maxLength="500"
@submitComment="handleCommentSubmit"
/>
@@ -237,7 +238,6 @@
const data = response.data.data;
profileName.value = data.author || '익명';
- console.log(data.author);
authorId.value = data.authorId;
boardTitle.value = data.title || '제목 없음';
boardContent.value = data.content || '';
@@ -580,7 +580,7 @@
LOCBRDPWD: password.value,
LOCBRDSEQ: currentBoardId.value,
});
- console.log('response: ', response);
+
if (response.data.code === 200 && response.data.data === true) {
password.value = '';
isPassword.value = false;