|
|
@ -9,6 +9,7 @@ const akismetClient = akismet.client({ |
|
|
|
exports.checkSpam = (comment, ip)=> { |
|
|
|
exports.checkSpam = (comment, ip)=> { |
|
|
|
if (process.env.AKISMET_KEY === 'MANUAL_REVIEW') { |
|
|
|
if (process.env.AKISMET_KEY === 'MANUAL_REVIEW') { |
|
|
|
console.log('已使用人工审核模式,评论审核后才会发表~'); |
|
|
|
console.log('已使用人工审核模式,评论审核后才会发表~'); |
|
|
|
|
|
|
|
comment.setACL(new AV.ACL({"*":{"read":false}})); |
|
|
|
comment.set('isSpam', true); |
|
|
|
comment.set('isSpam', true); |
|
|
|
comment.save(); |
|
|
|
comment.save(); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -39,6 +40,7 @@ exports.checkSpam = (comment, ip)=> { |
|
|
|
// comment.destroy();
|
|
|
|
// comment.destroy();
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
comment.set('isSpam', false); |
|
|
|
comment.set('isSpam', false); |
|
|
|
|
|
|
|
comment.setACL(new AV.ACL({"*":{"read":true}})); |
|
|
|
comment.save(); |
|
|
|
comment.save(); |
|
|
|
console.log('垃圾评论检测完成,放行~'); |
|
|
|
console.log('垃圾评论检测完成,放行~'); |
|
|
|
} |
|
|
|
} |
|
|
|