Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复,优化 #1032

Merged
merged 6 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pages/lib/vue/zone/MomentComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
)
.moment-status(v-if="commentData && commentData.status === 'unknown'")
.review(v-if="isAuthor || hasReviewPermission") 内容审核中
.hidden-content(v-else) 内容不可见
.hidden-content(v-else)
.moment-status(v-else-if="commentData && commentData.status === 'deleted'")
.deleted(v-if="permissions && permissions.reviewed") 内容已被删除
.hidden-content(v-else) 内容不可见
.deleted(v-if="hasReviewPermission") 内容已被删除
.hidden-content(v-else)
.moment-status(v-else-if="commentData && commentData.status === 'disabled'")
.disabled(v-if="permissions && permissions.reviewed") 内容已被屏蔽
.hidden-content(v-else) 内容不可见
.disabled(v-if="hasReviewPermission") 内容已被屏蔽
.hidden-content(v-else)
.moment-comment-item-content(v-html="commentData.content" v-if="type === 'comment'")
//- 图片视频
.moment-comment-item-files(v-if="type === 'comment'")
Expand Down Expand Up @@ -214,7 +214,7 @@ export default {
return state.uid && state.uid === this.commentData.uid;
},
hasReviewPermission() {
return this.permissions && this.permissions.reviewed;
return this.permissions && this.permissions.managementMoment;
},
panelClass() {
const classArr = [];
Expand Down Expand Up @@ -440,7 +440,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
height: 2rem;
height: 0.5rem;
}
.deleted {
color: #d57070;
Expand Down
11 changes: 6 additions & 5 deletions routes/api/v1/zone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,6 @@ router
if (!moment) {
ctx.throw(404, `动态 ID 错误 momentId=${mid}`);
}
await momentCheckerService.checkMomentPermission(
state.uid,
moment,
permission('review'),
);
let targetMoment;
let focusCommentId;
if (moment.parents.length > 0) {
Expand All @@ -258,6 +253,11 @@ router
targetMoment = moment;
focusCommentId = '';
}
await momentCheckerService.checkMomentPermission(
state.uid,
targetMoment,
permission('review'),
);
const [momentListData] = await db.MomentModel.extendMomentsListData(
[targetMoment],
state.uid,
Expand All @@ -269,6 +269,7 @@ router
reviewed:
state.uid &&
(permission('movePostsToRecycle') || permission('movePostsToDraft')),
managementMoment: permission('managementMoment'),
};
data.focusCommentId = focusCommentId;
if (state.uid) {
Expand Down