diff --git a/src/common/axios-interceptor.js b/src/common/axios-interceptor.js index c4163dd..3dd170d 100644 --- a/src/common/axios-interceptor.js +++ b/src/common/axios-interceptor.js @@ -37,14 +37,11 @@ $api.interceptors.response.use( }, function (error) { const toastStore = useToastStore(); - const currentPage = error.config.headers['X-Page-Route']; // 오류 응답 처리 if (error.response) { switch (error.response.status) { case 401: - if (currentPage === '/login') { - toastStore.onToast('아이디 혹은 비밀번호가 틀렸습니다.', 'e'); - } else { + if (!error.config.headers.isLogin) { toastStore.onToast('인증이 필요합니다.', 'e'); } break; diff --git a/src/common/common.js b/src/common/common.js index 5436651..e2f7f2d 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -1,18 +1,18 @@ /* 작성자 : 공현지 작성일 : 2025-01-17 - 수정자 : - 수정일 : + 수정자 : + 수정일 : 설명 : 공통 스크립트 */ import Quill from 'quill'; /* - *템플릿 사용법 : $common.변수 + *템플릿 사용법 : $common.변수 *setup() 사용법 : const { appContext } = getCurrentInstance(); - const $common = appContext.config.globalProperties.$common; - $common.변수 + const $common = appContext.config.globalProperties.$common; + $common.변수 */ const common = { // JSON 문자열로 Delta 타입을 변환 @@ -40,39 +40,39 @@ const common = { return null; // Delta 객체가 아니거나 ops가 없을 경우 null 반환 }, - /** - * Date 타입 문자열 포멧팅 - * - * @param {string} dateStr - * @return - * 1. Date type 인 경우 예시 '25-02-24 12:02' - * 2. Date type 이 아닌 경우 입력값 리턴 - * - */ - dateFormatter(dateStr) { - const date = new Date(dateStr); - const dateCheck = date.getTime(); +// /** +// * Date 타입 문자열 포멧팅 +// * +// * @param {string} dateStr +// * @return +// * 1. Date type 인 경우 예시 '25-02-24 12:02' +// * 2. Date type 이 아닌 경우 입력값 리턴 +// * +// */ +// dateFormatter(dateStr) { +// const date = new Date(dateStr); +// const dateCheck = date.getTime(); - if (isNaN(dateCheck)) { - return dateStr; - } else { - const { year, month, day, hours, minutes } = this.formatDateTime(date); - return `${year}-${month}-${day} ${hours}:${minutes}`; - } - }, +// if (isNaN(dateCheck)) { +// return dateStr; +// } else { +// const { year, month, day, hours, minutes } = this.formatDateTime(date); +// return `${year}-${month}-${day} ${hours}:${minutes}`; +// } +// }, - formatDateTime(date) { - const zeroFormat = num => (num < 10 ? `0${num}` : num); +// formatDateTime(date) { +// const zeroFormat = num => (num < 10 ? `0${num}` : num); - return { - year: date.getFullYear(), - month: zeroFormat(date.getMonth() + 1), - day: zeroFormat(date.getDate()), - hours: zeroFormat(date.getHours()), - minutes: zeroFormat(date.getMinutes()), - seconds: zeroFormat(date.getSeconds()), - }; - }, +// return { +// year: date.getFullYear(), +// month: zeroFormat(date.getMonth() + 1), +// day: zeroFormat(date.getDate()), +// hours: zeroFormat(date.getHours()), +// minutes: zeroFormat(date.getMinutes()), +// seconds: zeroFormat(date.getSeconds()), +// }; +// }, }; export default { diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 2d0c784..3518e55 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -124,7 +124,7 @@ const toggleComment = () => { // 부모 컴포넌트에 대댓글 추가 요청 const submitComment = (newComment) => { - emit('submitComment', { parentId: props.comment.commentId, ...newComment }); + emit('submitComment', { parentId: props.comment.commentId, ...newComment, LOCBRDTYP: newComment.LOCBRDTYP }); isComment.value = false; }; diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index 30e9084..76b93b0 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -76,26 +76,26 @@ const props = defineProps({ default: false } }); - const comment = ref(''); const password = ref(''); -const isCheck = ref(props.unknown); - +const isCheck = ref(false); const emit = defineEmits(['submitComment']); -watch(() => props.unknown, (newVal) => { - isCheck.value = newVal; -}); - function handleCommentSubmit() { + if (props.unknown && isCheck.value && !password.value) { + alert('익명 댓글을 작성하려면 비밀번호를 입력해야 합니다.'); + return; + } + const LOCBRDTYP = isCheck.value ? '300102' : null; emit('submitComment', { comment: comment.value, password: isCheck.value ? password.value : '', + LOCBRDTYP, + isCheck: isCheck.value }); comment.value = ''; password.value = ''; + isCheck.value = false; // 초기화 } - - diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index dd23985..f23c730 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -62,11 +62,8 @@ const props = defineProps({ }, profileName: { type: String, -<<<<<<< HEAD default: '익명', -======= default: '', ->>>>>>> board-comment }, unknown: { type: Boolean, diff --git a/src/components/button/WriteBtn.vue b/src/components/button/WriteBtn.vue index a9b5ca1..41b56c9 100644 --- a/src/components/button/WriteBtn.vue +++ b/src/components/button/WriteBtn.vue @@ -4,10 +4,6 @@ - diff --git a/src/components/voteboard/voteCard.vue b/src/components/voteboard/voteCard.vue index 6662bad..f7b91ca 100644 --- a/src/components/voteboard/voteCard.vue +++ b/src/components/voteboard/voteCard.vue @@ -1,55 +1,71 @@ diff --git a/src/components/voteboard/voteCardList.vue b/src/components/voteboard/voteCardList.vue index d527537..71fa5b6 100644 --- a/src/components/voteboard/voteCardList.vue +++ b/src/components/voteboard/voteCardList.vue @@ -3,9 +3,15 @@ + :data="item" + /> @@ -16,14 +22,30 @@ const props = defineProps({ type: Array, required: true, }, + }); -const emit = defineEmits(['addContents','checkedNames']); +const emit = defineEmits(['addContents','checkedNames','endVoteId','voteEnded','voteDelete']); const addContents = (itemList ,voteId) =>{ emit('addContents',itemList ,voteId); } const checkedNames = (numList) =>{ emit('checkedNames',numList); } +const endVoteId = (VoteId) =>{ + emit('endVoteId',VoteId); +} +const voteEnded = (id) =>{ + emit('voteEnded',id); +} +const voteDelete = (id) =>{ + emit('voteDelete',id); +} +const updateVote = (id) =>{ + emit('updateVote',id); +} +const randomList = (randomList , id) =>{ + emit('randomList',randomList,id); +} diff --git a/src/components/voteboard/voteResultCard.vue b/src/components/voteboard/voteResultCard.vue index 2c318a5..13b7a15 100644 --- a/src/components/voteboard/voteResultCard.vue +++ b/src/components/voteboard/voteResultCard.vue @@ -2,14 +2,15 @@
@@ -17,6 +18,16 @@ diff --git a/src/components/voteboard/voteResultList.vue b/src/components/voteboard/voteResultList.vue index c0f9a66..5a8e4d0 100644 --- a/src/components/voteboard/voteResultList.vue +++ b/src/components/voteboard/voteResultList.vue @@ -2,9 +2,10 @@
- + - +
@@ -12,6 +13,28 @@