twikoo-func 1.6.36 → 1.6.37

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 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -622,11 +622,12 @@ 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
626
  const commentDo = {
626
627
  uid: await getUid(),
627
628
  nick: comment.nick ? comment.nick : '匿名',
628
629
  mail: comment.mail ? comment.mail : '',
629
- mailMd5: comment.mail ? sha256(normalizeMail(comment.mail)) : '',
630
+ mailMd5: comment.mail ? hashMethod(normalizeMail(comment.mail)) : '',
630
631
  link: comment.link ? comment.link : '',
631
632
  ua: comment.ua,
632
633
  ip: auth.getClientIP(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twikoo-func",
3
- "version": "1.6.36",
3
+ "version": "1.6.37",
4
4
  "description": "A simple comment system.",
5
5
  "author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
6
6
  "license": "MIT",