Skip to content

Commit

Permalink
feat: v3.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Dec 7, 2021
1 parent 287edf0 commit 1303ad7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

### v3.6.3 (2021-12-07)

**Feature**

- Fix archive article query options

### v3.6.2 (2021-12-07)

**Feature**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodepress",
"version": "3.6.2",
"version": "3.6.3",
"description": "RESTful API service for Surmon.me blog",
"author": {
"name": "Surmon",
Expand Down
4 changes: 3 additions & 1 deletion src/modules/archive/archive.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class ArchiveService {

private getAllArticles(): Promise<Article[]> {
return this.articleModel
.find({ state: PublishState.Published, public: PublicState.Public })
.find({ state: PublishState.Published, public: PublicState.Public }, null, {
select: '-password -content',
})
.sort({ _id: SortType.Desc })
.exec()
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/comment/comment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ export class CommentService {
private async validateCommentByBlacklist(comment: Comment) {
const { blacklist } = await this.optionService.getDBOption()
const { keywords, mails, ips } = blacklist
const blockIp = ips.includes(comment.ip)
const blockIP = ips.includes(comment.ip)
const blockEmail = mails.includes(comment.author.email)
const blockKeyword = keywords.length && new RegExp(`${keywords.join('|')}`, 'ig').test(comment.content)
const isBlocked = blockIp || blockEmail || blockKeyword
const isBlocked = blockIP || blockEmail || blockKeyword
if (isBlocked) {
throw '内容 || IP || 邮箱 -> 不合法'
}
Expand Down

0 comments on commit 1303ad7

Please sign in to comment.