From 56fd71f2661fff2bda19ff2a6f756e1b1e3b17ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Tue, 14 Oct 2025 15:12:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Comments/index.tsx | 29 +++++++++++++++-------------- src/services/commentServices.ts | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/Comments/index.tsx b/src/components/Comments/index.tsx index 197e4b5..67c6c39 100644 --- a/src/components/Comments/index.tsx +++ b/src/components/Comments/index.tsx @@ -181,7 +181,7 @@ function CommentItem(props: { blink_id, } = props; const currentUserInfo = useUserInfo(); - const isGamePublisher = publisher_id === comment.user.id; + const isGamePublisher = publisher_id === currentUserInfo.id; const isCommentPublisher = currentUserInfo.id === comment.user.id; return ( {getRelativeDay(comment.create_time)} - 上海 + {comment.user.province} 回复 - {isGamePublisher || isCommentPublisher} - - handleDelete({ - parent_id: comment.parent_id, - id: comment.id, - }) - } - > - 删除 - + {(isGamePublisher || isCommentPublisher) && ( + + handleDelete({ + parent_id: comment.parent_id, + id: comment.id, + }) + } + > + 删除 + + )} {!isReplyComment(comment) && diff --git a/src/services/commentServices.ts b/src/services/commentServices.ts index 1c89fde..474107a 100644 --- a/src/services/commentServices.ts +++ b/src/services/commentServices.ts @@ -10,6 +10,7 @@ export interface UserInfo { id: number nickname: string avatar_url: string + province: string } export type BaseComment = {