Authored by 徐炜

爬虫限制重构规则策略

@@ -11,11 +11,7 @@ const IP_WHITE_LIST = [ @@ -11,11 +11,7 @@ const IP_WHITE_LIST = [
11 ]; 11 ];
12 12
13 const limiter = (rule, policy, context) => { 13 const limiter = (rule, policy, context) => {
14 - return rule({  
15 - req: context.req,  
16 - res: context.res,  
17 - next: context.next  
18 - }, policy); 14 + return rule(context, policy);
19 }; 15 };
20 16
21 module.exports = (req, res, next) => { 17 module.exports = (req, res, next) => {