From 9a470268b246512f71099e88bab0ee352a8f4a6f Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 17 Nov 2020 19:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/demon/messageBoard.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } }