...
|
...
|
@@ -13,6 +13,7 @@ import CommentPlaceholder from './comment-placeholder'; |
|
|
import { get } from 'lodash';
|
|
|
|
|
|
const { mapActions } = createNamespacedHelpers('comment');
|
|
|
const {mapMutations: articleMapMutations } = createNamespacedHelpers('article');
|
|
|
|
|
|
const ITEM = {
|
|
|
comment: '回复',
|
...
|
...
|
@@ -28,11 +29,13 @@ export default { |
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['setCommentStatus']),
|
|
|
...articleMapMutations(['SUB_ARTICLE_COMMENT_COUNT']),
|
|
|
async onClick() {
|
|
|
const authorUid = this.$attrs.authorUid;
|
|
|
const commentUid = this.$attrs.commentUid;
|
|
|
const uid = get(await this.$sdk.getUser(), 'uid', 0);
|
|
|
const commentId = this.$attrs['dest-id'];
|
|
|
const articleId = this.$attrs['article-id'];
|
|
|
let menu = [];
|
|
|
|
|
|
if (authorUid === uid || commentUid === uid) {
|
...
|
...
|
@@ -76,6 +79,7 @@ export default { |
|
|
time: 2000
|
|
|
}).show();
|
|
|
this.$emit('remove-comment', { commentId });
|
|
|
this.SUB_ARTICLE_COMMENT_COUNT({ articleId });
|
|
|
} else {
|
|
|
this.$createToast({
|
|
|
txt: '删除失败,请重试',
|
...
|
...
|
|