익명 닉네임 수정
All checks were successful
LocalNet_front/pipeline/head This commit looks good

This commit is contained in:
dyhj625 2025-03-21 10:46:58 +09:00
parent 57e3489af5
commit e8753588ca
4 changed files with 22 additions and 11 deletions

View File

@ -4,7 +4,7 @@
:unknown="comment.author === '익명'" :unknown="comment.author === '익명'"
:isCommentAuthor="isCommentAuthor" :isCommentAuthor="isCommentAuthor"
:boardId="comment.boardId" :boardId="comment.boardId"
:profileName="comment.nickname ? comment.nickname : comment.author" :profileName="displayName"
:date="comment.createdAt" :date="comment.createdAt"
:comment="comment" :comment="comment"
:profileImg="comment.profileImg" :profileImg="comment.profileImg"
@ -76,10 +76,15 @@
type: Boolean, type: Boolean,
default: false, default: false,
}, },
nickname: {
type: String,
default: '',
},
isCommentAuthor: { isCommentAuthor: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isPlusButton: { isPlusButton: {
type: Boolean, type: Boolean,
default: true, default: true,
@ -113,6 +118,10 @@
editCommentAlert: String, editCommentAlert: String,
}); });
const displayName = computed(() => {
return props.nickname? props.nickname: props.comment.author;
});
// emits // emits
const emit = defineEmits([ const emit = defineEmits([
'submitComment', 'submitComment',

View File

@ -7,6 +7,7 @@
:isCommentAuthor="comment.isCommentAuthor" :isCommentAuthor="comment.isCommentAuthor"
:isEditTextarea="comment.isEditTextarea" :isEditTextarea="comment.isEditTextarea"
:isDeleted="isDeleted" :isDeleted="isDeleted"
:nickname="comment.nickname"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:passwordCommentAlert="passwordCommentAlert || ''" :passwordCommentAlert="passwordCommentAlert || ''"
:currentPasswordCommentId="currentPasswordCommentId" :currentPasswordCommentId="currentPasswordCommentId"
@ -32,6 +33,7 @@
:isPlusButton="false" :isPlusButton="false"
:isLike="true" :isLike="true"
:isCommentProfile="true" :isCommentProfile="true"
:nickname="child.nickname"
:isCommentAuthor="child.isCommentAuthor" :isCommentAuthor="child.isCommentAuthor"
:isCommentPassword="isCommentPassword" :isCommentPassword="isCommentPassword"
:currentPasswordCommentId="currentPasswordCommentId" :currentPasswordCommentId="currentPasswordCommentId"

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="me-2"> <div class="me-2">
<h6 class="mb-0">{{ displayName }}</h6> <h6 class="mb-0">{{ profileName ? profileName : nickname }}</h6>
<div class="profile-detail"> <div class="profile-detail">
<span>{{ date }}</span> <span>{{ date }}</span>
<template v-if="showDetail"> <template v-if="showDetail">
@ -58,11 +58,11 @@
type: Number, type: Number,
required: false, required: false,
}, },
nickname: { profileName: {
type: String, type: String,
default: '', default: '',
}, },
profileName: { nickname: {
type: String, type: String,
default: '', default: '',
}, },
@ -105,10 +105,6 @@
const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']); const emit = defineEmits(['updateReaction', 'editClick', 'deleteClick']);
const $common = inject('common'); const $common = inject('common');
const displayName = computed(() => {
return props.nickname?props.nickname : props.name;
});
const isDeletedComment = computed(() => { const isDeletedComment = computed(() => {
return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw; return props.comment?.content === '삭제된 댓글입니다' && props.comment?.updateAtRaw !== props.comment?.createdAtRaw;
}); });

View File

@ -8,7 +8,7 @@
<div class="pb-5 border-bottom"> <div class="pb-5 border-bottom">
<BoardProfile <BoardProfile
:boardId="currentBoardId" :boardId="currentBoardId"
:profileName="profileName" :profileName="displayName"
:unknown="unknown" :unknown="unknown"
:profileImg="profileImg" :profileImg="profileImg"
:views="views" :views="views"
@ -176,6 +176,10 @@
const authorId = ref(''); // id const authorId = ref(''); // id
const editCommentAlert = ref({}); //, const editCommentAlert = ref({}); //,
const displayName = computed(() => {
return nickname.value && unknown.value ? nickname.value : profileName.value;
});
const isAuthor = computed(() => currentUserId.value === authorId.value); const isAuthor = computed(() => currentUserId.value === authorId.value);
const commentsWithAuthStatus = computed(() => { const commentsWithAuthStatus = computed(() => {
const updatedComments = comments.value.map(comment => ({ const updatedComments = comments.value.map(comment => ({
@ -325,7 +329,7 @@
likeCount: comment.likeCount || 0, likeCount: comment.likeCount || 0,
dislikeCount: comment.dislikeCount || 0, dislikeCount: comment.dislikeCount || 0,
profileImg: comment.profileImg || '', profileImg: comment.profileImg || '',
nickname: comment.LOCCMTNIC, nickname: comment.LOCCMTNIC || '',
likeClicked: comment.likeClicked || false, likeClicked: comment.likeClicked || false,
dislikeClicked: comment.dislikeClicked || false, dislikeClicked: comment.dislikeClicked || false,
createdAtRaw: comment.LOCCMTRDT, // createdAtRaw: comment.LOCCMTRDT, //
@ -355,7 +359,7 @@
parentId: reply.LOCCMTPNT, // ID parentId: reply.LOCCMTPNT, // ID
content: reply.LOCCMTRPY || '내용 없음', content: reply.LOCCMTRPY || '내용 없음',
createdAtRaw: reply.LOCCMTRDT, createdAtRaw: reply.LOCCMTRDT,
nickname: reply.LOCCMTNIC, nickname: reply.LOCCMTNIC || '',
// createdAt: formattedDate(reply.LOCCMTRDT), // createdAt: formattedDate(reply.LOCCMTRDT),
//createdAtRaw: new Date(reply.LOCCMTUDT), //createdAtRaw: new Date(reply.LOCCMTUDT),
createdAt: formattedDate(reply.LOCCMTUDT) + (reply.LOCCMTUDT !== reply.LOCCMTRDT ? ' (수정됨)' : ''), createdAt: formattedDate(reply.LOCCMTUDT) + (reply.LOCCMTUDT !== reply.LOCCMTRDT ? ' (수정됨)' : ''),