diff --git a/src/views/newMap/displayNew/demon/messageBoard.vue b/src/views/newMap/displayNew/demon/messageBoard.vue index 0d5cb2c7a..ca0741d54 100644 --- a/src/views/newMap/displayNew/demon/messageBoard.vue +++ b/src/views/newMap/displayNew/demon/messageBoard.vue @@ -153,6 +153,10 @@ export default { this.$message.error('留言内容超出最大长度!'); return; } + if (!this.content) { + this.$message.error('留言内容不能为空!'); + return; + } answerPost({postId: 1, content: this.content}).then(resp => { this.pageNum = Math.ceil(resp.data / this.pageSize); this.handleCurrentChange(); @@ -305,7 +309,7 @@ export default { changeCommentContent(val) { if (this.replyUserName && val.startsWith(this.replyUserName)) { this.commentContentNoName = val.slice(this.replyUserName.length); - } else { + } else if (this.replyUserName) { this.commentContent = this.replyUserName + this.commentContentNoName; } }