Merge pull request #53 from leafinote/master

set the ACL of spam comment record to nonreadable
dependabot/npm_and_yarn/mixin-deep-1.3.2
Deserts 5 years ago committed by GitHub
commit db68b58150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      utilities/check-spam.js

@ -1,4 +1,5 @@
'use strict';
const AV = require('leanengine');
const akismet = require('akismet-api');
const akismetClient = akismet.client({
key : process.env.AKISMET_KEY,
@ -33,6 +34,7 @@ exports.checkSpam = (comment, ip)=> {
if (spam) {
console.log('逮到一只垃圾评论,烧死它!用文火~');
comment.set('isSpam', true);
comment.setACL(new AV.ACL({"*":{"read":false}}));
comment.save();
// comment.destroy();
} else {
@ -100,4 +102,4 @@ exports.submitHam = (comment)=> {
}
else console.log('Akismet key 异常!');
});
};
};

Loading…
Cancel
Save