tkserver 1.6.37 → 1.6.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +2 -2
  2. package/mongo.js +2 -2
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -659,7 +659,7 @@ async function parse (comment, request) {
659
659
  const isAdminUser = isAdmin(request.body.accessToken)
660
660
  const isBloggerMail = equalsMail(comment.mail, config.BLOGGER_EMAIL)
661
661
  if (isBloggerMail && !isAdminUser) throw new Error('请先登录管理面板,再使用博主身份发送评论')
662
- const hashMethod = this.gravatarCdn === 'cravatar.cn' ? md5 : sha256
662
+ const hashMethod = config.GRAVATAR_CDN === 'cravatar.cn' ? md5 : sha256
663
663
  const commentDo = {
664
664
  _id: uuidv4().replace(/-/g, ''),
665
665
  uid: request.body.accessToken,
@@ -681,7 +681,7 @@ async function parse (comment, request) {
681
681
  }
682
682
  if (isQQ(comment.mail)) {
683
683
  commentDo.mail = addQQMailSuffix(comment.mail)
684
- commentDo.mailMd5 = md5(normalizeMail(commentDo.mail))
684
+ commentDo.mailMd5 = hashMethod(normalizeMail(commentDo.mail))
685
685
  commentDo.avatar = await getQQAvatar(comment.mail)
686
686
  }
687
687
  return commentDo
package/mongo.js CHANGED
@@ -638,7 +638,7 @@ async function parse (comment, request) {
638
638
  const isAdminUser = isAdmin(request.body.accessToken)
639
639
  const isBloggerMail = equalsMail(comment.mail, config.BLOGGER_EMAIL)
640
640
  if (isBloggerMail && !isAdminUser) throw new Error('请先登录管理面板,再使用博主身份发送评论')
641
- const hashMethod = this.gravatarCdn === 'cravatar.cn' ? md5 : sha256
641
+ const hashMethod = config.GRAVATAR_CDN === 'cravatar.cn' ? md5 : sha256
642
642
  const commentDo = {
643
643
  _id: uuidv4().replace(/-/g, ''),
644
644
  uid: request.body.accessToken,
@@ -660,7 +660,7 @@ async function parse (comment, request) {
660
660
  }
661
661
  if (isQQ(comment.mail)) {
662
662
  commentDo.mail = addQQMailSuffix(comment.mail)
663
- commentDo.mailMd5 = md5(normalizeMail(commentDo.mail))
663
+ commentDo.mailMd5 = hashMethod(normalizeMail(commentDo.mail))
664
664
  commentDo.avatar = await getQQAvatar(comment.mail)
665
665
  }
666
666
  return commentDo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tkserver",
3
- "version": "1.6.37",
3
+ "version": "1.6.38",
4
4
  "description": "A simple comment system.",
5
5
  "keywords": [
6
6
  "twikoo",
@@ -31,7 +31,7 @@
31
31
  "get-user-ip": "^1.0.1",
32
32
  "lokijs": "^1.5.12",
33
33
  "mongodb": "^6.3.0",
34
- "twikoo-func": "1.6.37",
34
+ "twikoo-func": "1.6.38",
35
35
  "uuid": "^8.3.2"
36
36
  }
37
37
  }