This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
6,331 additions
and
5,669 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,27 +286,30 @@ | |
methods: { | ||
handleSubmitClick() { | ||
if (isEmpty(this.comment.author)) { | ||
this.warnings.push("评论者昵称不能为空"); | ||
return; | ||
// this.warnings.push("评论者昵称不能为空"); | ||
// return; | ||
this.comment.author = 'Anonymous'; | ||
} | ||
if (isEmpty(this.comment.email)) { | ||
this.warnings.push("邮箱不能为空"); | ||
return; | ||
// this.comment.email = '[email protected]'; | ||
} | ||
if (isEmpty(this.comment.content)) { | ||
this.warnings.push("评论内容不能为空"); | ||
return; | ||
} | ||
// comment 需要是 Markdown 格式的 | ||
this.comment.content = marked(this.comment.content); | ||
const content = marked(this.comment.content); | ||
// Submit the comment | ||
this.comment.postId = this.targetId; | ||
if (this.replyComment) { | ||
// Set parent id if available | ||
this.comment.parentId = this.replyComment.id; | ||
} | ||
commentApi | ||
.createComment(this.target, this.comment) | ||
.createComment(this.target, {...this.comment, content}) | ||
.then(response => { | ||
// Store comment author, email, authorUrl | ||
localStorage.setItem("comment-author", this.comment.author); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters