익명페이지에서 로그인 댓글 이미지 보이게 수정

This commit is contained in:
kimdaae328 2025-02-25 12:00:26 +09:00
parent 1500ea25e0
commit 4bab9ed5f0
3 changed files with 17 additions and 20 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<BoardProfile <BoardProfile
:unknown="unknown" :unknown="comment.author === '익명'"
:isCommentAuthor="isCommentAuthor" :isCommentAuthor="isCommentAuthor"
:boardId="comment.boardId" :boardId="comment.boardId"
:profileName="comment.author" :profileName="comment.author"
@ -29,8 +29,8 @@
</div> </div>
<span v-if="passwordCommentAlert" class="invalid-feedback d-block text-start">{{ passwordCommentAlert }}</span> <span v-if="passwordCommentAlert" class="invalid-feedback d-block text-start">{{ passwordCommentAlert }}</span>
</div> </div>
<p>authorId:{{ comment.authorId }}</p> <!-- <p>authorId:{{ comment.authorId }}</p>
<p>코멘트 비교: {{comment.isCommentAuthor}}</p> <p>코멘트 비교: {{comment.isCommentAuthor}}</p> -->
<div class="mt-6"> <div class="mt-6">
@ -47,20 +47,21 @@
</div> </div>
<PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/> <PlusButton v-if="isPlusButton" @click="toggleComment" class="mt-6"/>
<BoardCommentArea v-if="isComment" @submitComment="submitComment"/> <BoardCommentArea v-if="isComment" :unknown="unknown" @submitComment="submitComment"/>
<!-- 대댓글 --> <!-- 대댓글 -->
<ul v-if="comment.children && comment.children.length" class="list-unstyled"> <ul v-if="comment.children && comment.children.length" class="list-unstyled">
<li <li
v-for="child in comment.children" v-for="child in comment.children"
:key="child.commentId" :key="child.commentId"
class="mt-8 pt-6 ps-10 border-top" class="mt-8 pt-6 ps-10 border-top"
> >
<!-- <p>대댓글 데이터(JSON): {{ JSON.stringify(child, null, 2) }}</p> --> <!-- <p>대댓글 데이터(JSON): {{ JSON.stringify(child, null, 2) }}</p> -->
<!-- <p>comment child: {{ comment.children }}</p> --> <!-- <p>comment child: {{ comment.children }}</p> -->
<!-- :unknown="child.author === '익명'" -->
<BoardComment <BoardComment
:comment="child" :comment="child"
:unknown="unknown" :unknown="child.author === '익명'"
:isPlusButton="false" :isPlusButton="false"
:isLike="true" :isLike="true"
:isCommentProfile="true" :isCommentProfile="true"

View File

@ -79,14 +79,10 @@ const props = defineProps({
const comment = ref(''); const comment = ref('');
const password = ref(''); const password = ref('');
const isCheck = ref(''); const isCheck = ref(props.unknown);
const emit = defineEmits(['submitComment']); const emit = defineEmits(['submitComment']);
watch(() => props.unknown, (newVal) => {
isCheck.value = newVal;
});
function handleCommentSubmit() { function handleCommentSubmit() {
emit('submitComment', { emit('submitComment', {
comment: comment.value, comment: comment.value,

View File

@ -76,9 +76,9 @@
@updateReaction="handleUpdateReaction" @updateReaction="handleUpdateReaction"
/> />
</div> </div>
<p>현재 로그인한 사용자 ID: {{ currentUserId }}</p> <!-- <p>현재 로그인한 사용자 ID: {{ currentUserId }}</p>
<p>게시글 작성자: {{ authorId }}</p> <p>게시글 작성자: {{ authorId }}</p>
<p>isAuthor : {{ isAuthor }}</p> <p>isAuthor : {{ isAuthor }}</p> -->
<!-- <p>use이미지:{{userStore.user.img}}</p> --> <!-- <p>use이미지:{{userStore.user.img}}</p> -->
<!-- <img :src="`http://localhost:10325/upload/img/profile/${userStore.user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/> --> <!-- <img :src="`http://localhost:10325/upload/img/profile/${userStore.user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/> -->
@ -208,7 +208,7 @@ const fetchBoardDetails = async () => {
const response = await axios.get(`board/${currentBoardId.value}`); const response = await axios.get(`board/${currentBoardId.value}`);
const data = response.data.data; const data = response.data.data;
// console.log(data) console.log(data)
// API // API
// const boardDetail = data.boardDetail || {}; // const boardDetail = data.boardDetail || {};
@ -372,12 +372,12 @@ const fetchComments = async (page = 1) => {
// //
const handleCommentSubmit = async ({ comment, password }) => { const handleCommentSubmit = async ({ comment, password }) => {
console.log('댓글') // console.log('')
// //
// if (!password) { if (unknown && !password) {
// passwordAlert.value = " ."; passwordAlert.value = "비밀번호를 입력해야 합니다.";
// return; return;
// } }
// console.log(' ') // console.log(' ')