留言板调整

This commit is contained in:
fan 2020-11-17 19:06:59 +08:00
parent 842c10a3f3
commit 9a470268b2

View File

@ -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;
}
}