tkserver 1.6.1 → 1.6.2
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.
- package/index.js +3 -3
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -570,7 +570,7 @@ async function commentSubmit (event, request) {
|
|
|
570
570
|
console.log('开始异步垃圾检测、发送评论通知')
|
|
571
571
|
console.time('POST_SUBMIT')
|
|
572
572
|
await Promise.race([
|
|
573
|
-
axios.post(`
|
|
573
|
+
axios.post(`http://${request.headers.host}`, {
|
|
574
574
|
event: 'POST_SUBMIT',
|
|
575
575
|
comment
|
|
576
576
|
}, { headers: { 'x-twikoo-recursion': config.ADMIN_PASS || 'true' } }),
|
|
@@ -597,14 +597,14 @@ async function getParentComment (currentComment) {
|
|
|
597
597
|
const parentComment = db
|
|
598
598
|
.getCollection('comment')
|
|
599
599
|
.findOne({ _id: currentComment.pid })
|
|
600
|
-
return parentComment
|
|
600
|
+
return parentComment
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
// 异步垃圾检测、发送评论通知
|
|
604
604
|
async function postSubmit (comment, request) {
|
|
605
605
|
if (!isRecursion(request)) return { code: RES_CODE.FORBIDDEN }
|
|
606
606
|
// 垃圾检测
|
|
607
|
-
const isSpam = await postCheckSpam(comment)
|
|
607
|
+
const isSpam = await postCheckSpam(comment, config)
|
|
608
608
|
await saveSpamCheckResult(comment, isSpam)
|
|
609
609
|
// 发送通知
|
|
610
610
|
await sendNotice(comment, config, getParentComment)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tkserver",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "A simple comment system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twikoo",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"lokijs": "^1.5.12",
|
|
28
|
-
"twikoo-func": "1.6.
|
|
28
|
+
"twikoo-func": "1.6.2",
|
|
29
29
|
"uuid": "^8.3.2"
|
|
30
30
|
}
|
|
31
31
|
}
|