twikoo-func 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 (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -622,7 +622,7 @@ async function parse (comment) {
622
622
  const isAdminUser = await isAdmin()
623
623
  const isBloggerMail = equalsMail(comment.mail, config.BLOGGER_EMAIL)
624
624
  if (isBloggerMail && !isAdminUser) throw new Error('请先登录管理面板,再使用博主身份发送评论')
625
- const hashMethod = this.gravatarCdn === 'cravatar.cn' ? md5 : sha256
625
+ const hashMethod = config.GRAVATAR_CDN === 'cravatar.cn' ? md5 : sha256
626
626
  const commentDo = {
627
627
  uid: await getUid(),
628
628
  nick: comment.nick ? comment.nick : '匿名',
@@ -643,7 +643,7 @@ async function parse (comment) {
643
643
  }
644
644
  if (isQQ(comment.mail)) {
645
645
  commentDo.mail = addQQMailSuffix(comment.mail)
646
- commentDo.mailMd5 = md5(normalizeMail(commentDo.mail))
646
+ commentDo.mailMd5 = hashMethod(normalizeMail(commentDo.mail))
647
647
  commentDo.avatar = await getQQAvatar(comment.mail)
648
648
  }
649
649
  return commentDo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twikoo-func",
3
- "version": "1.6.37",
3
+ "version": "1.6.38",
4
4
  "description": "A simple comment system.",
5
5
  "author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
6
6
  "license": "MIT",