twikoo-func 1.4.13 → 1.4.14

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 +6 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Twikoo cloudbase function v1.4.13
2
+ * Twikoo cloudbase function v1.4.14
3
3
  * (c) 2020-present iMaeGoo
4
4
  * Released under the MIT License.
5
5
  */
@@ -31,7 +31,7 @@ const window = new JSDOM('').window
31
31
  const DOMPurify = createDOMPurify(window)
32
32
 
33
33
  // 常量 / constants
34
- const VERSION = '1.4.13'
34
+ const VERSION = '1.4.14'
35
35
  const RES_CODE = {
36
36
  SUCCESS: 0,
37
37
  FAIL: 1000,
@@ -939,7 +939,7 @@ async function noticeMaster (comment) {
939
939
  if (hasIMPushConfig && config.SC_MAIL_NOTIFY !== 'true') return
940
940
  const SITE_NAME = config.SITE_NAME
941
941
  const NICK = comment.nick
942
- const IMG = comment.avatar
942
+ const IMG = getAvatar(comment)
943
943
  const IP = comment.ip
944
944
  const MAIL = comment.mail
945
945
  const COMMENT = comment.comment
@@ -1104,8 +1104,8 @@ async function noticeReply (currentComment) {
1104
1104
  // 回复自己的评论,不邮件通知
1105
1105
  if (currentComment.mail === parentComment.mail) return
1106
1106
  const PARENT_NICK = parentComment.nick
1107
- const IMG = currentComment.avatar
1108
- const PARENT_IMG = parentComment.avatar
1107
+ const IMG = getAvatar(currentComment)
1108
+ const PARENT_IMG = getAvatar(parentComment)
1109
1109
  const SITE_NAME = config.SITE_NAME
1110
1110
  const NICK = currentComment.nick
1111
1111
  const COMMENT = currentComment.comment
@@ -1583,6 +1583,7 @@ async function readConfig () {
1583
1583
 
1584
1584
  // 写入配置
1585
1585
  async function writeConfig (newConfig) {
1586
+ if (!Object.keys(newConfig).length) return 0
1586
1587
  console.log('写入配置:', newConfig)
1587
1588
  try {
1588
1589
  let updated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twikoo-func",
3
- "version": "1.4.13",
3
+ "version": "1.4.14",
4
4
  "description": "A simple comment system based on Tencent CloudBase (tcb).",
5
5
  "author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
6
6
  "license": "MIT",