...
|
...
|
@@ -48,10 +48,10 @@ module.exports = (limiter, policy) => { |
|
|
if (!results[key]) {
|
|
|
operation.push(cache.setAsync(cacheKey, 1, +key));
|
|
|
} else if (+results[key] > +val) {
|
|
|
logger.warn(`${config.app}:limiter:${limiter.remoteIp}`);
|
|
|
logger.warn(`pc:limiter:${limiter.remoteIp}`);
|
|
|
|
|
|
// ip限制1小时
|
|
|
operation.push(cache.setAsync(`${config.app}:limiter:${limiter.remoteIp}`, 1, limiterIpTime));
|
|
|
operation.push(cache.setAsync(`pc:limiter:${limiter.remoteIp}`, 1, limiterIpTime));
|
|
|
return Promise.resolve(policy);
|
|
|
} else {
|
|
|
operation.push(cache.incrAsync(cacheKey, 1));
|
...
|
...
|
|