diff --git a/api/v2/all.api.js b/api/v2/all.api.js index 6a09325..6b13cca 100644 --- a/api/v2/all.api.js +++ b/api/v2/all.api.js @@ -77,7 +77,7 @@ export default { }, // 提交回复 addPostCommentReply: (commentName, data) => { - return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/replay`, data) + return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, data) }, /** diff --git a/common/mixins/index.js b/common/mixins/index.js index ca762e5..6582e2e 100644 --- a/common/mixins/index.js +++ b/common/mixins/index.js @@ -60,7 +60,7 @@ export default { // 设置页面标题 fnSetPageTitle(title) { uni.setNavigationBarTitle({ - title: title || (this.haloConfig && this.haloConfig.startConfig.title) || "uni-halo", + title: title || this.haloConfig?.appConfig?.startConfig?.title || "uni-halo", }) }, diff --git a/components/comment-list/comment-list.vue b/components/comment-list/comment-list.vue index 92e0b9a..33e1537 100644 --- a/components/comment-list/comment-list.vue +++ b/components/comment-list/comment-list.vue @@ -30,8 +30,7 @@ - 文章已开启禁止评论 - - 抢沙发 + 抢沙发 @@ -146,11 +145,9 @@ export default { return uni.$tm.toast('文章已禁止评论!'); } let _comment = {}; + console.log('data', data) if (data) { - let { - type, - comment - } = data; + let {type, comment} = data; // 来自用户 _comment = { isComment: false, @@ -165,16 +162,14 @@ export default { _comment = { isComment: true, postName: this.post.metadata.name, - title: '评论文章:' + this.post.spec.title, + title: '新增评论', formPage: 'comment_list', from: 'posts', type: 'post' }; } - this.$emit("on-comment", { - _comment - }) + this.$emit("on-comment", _comment) }, fnCopyContent(content) { uni.$tm.u.setClipboardData(content); diff --git a/components/comment-modal/comment-modal.vue b/components/comment-modal/comment-modal.vue index e59046c..174218c 100644 --- a/components/comment-modal/comment-modal.vue +++ b/components/comment-modal/comment-modal.vue @@ -169,7 +169,7 @@ export default { } this.$httpApi.v2.addPostComment(commentForm) .then(res => { - uni.$tm.toast('评论成功!'); + uni.$tm.toast('评论成功,可能需要审核!'); // 更新评论者信息 this.handleSetVisitor(); this.handleClose(true) @@ -196,7 +196,7 @@ export default { } this.$httpApi.v2.addPostCommentReply(this.form.postName, replyForm) .then(res => { - uni.$tm.toast('回复成功!'); + uni.$tm.toast('回复成功,可能需要审核!'); // 更新评论者信息 this.handleSetVisitor(); this.handleClose(true) diff --git a/pagesA/article-detail/article-detail.vue b/pagesA/article-detail/article-detail.vue index af43a52..ac7a54e 100644 --- a/pagesA/article-detail/article-detail.vue +++ b/pagesA/article-detail/article-detail.vue @@ -317,11 +317,7 @@ export default { // 原文链接:个人资质=可以打开公众号文章;非个人:任意链接地址(需在小程序后台配置) originalURL() { - if ('unihalo_originalURL' in this.result?.metadata?.annotations) { - return this.result?.metadata?.annotations?.unihalo_originalURL; - } else { - return ''; - } + return this.result?.metadata?.annotations?.unihalo_originalURL || "" }, calcIsShowComment() { @@ -445,12 +441,12 @@ export default { } this.commentModal.isComment = true; this.commentModal.postName = this.result.metadata.name; - this.commentModal.title = this.result.spec.title; + this.commentModal.title = "新增评论"; this.commentModal.show = true; }, fnOnComment(data) { this.commentModal.isComment = data.isComment; - this.commentModal.postName = data.name; + this.commentModal.postName = data.postName; this.commentModal.title = data.title; this.commentModal.show = true; },