|
@@ -70,8 +70,8 @@ class ApiAgent implements MiddlewareInterface
|
|
LogUtil::info('请求参数', $action['controller'], $action['action'], $params);
|
|
LogUtil::info('请求参数', $action['controller'], $action['action'], $params);
|
|
|
|
|
|
//接口限流,写到中间件中
|
|
//接口限流,写到中间件中
|
|
- if (!RedisUtil::getInstance(RedisKeyEnum::API_REQUEST_TRAFFIC)->requestLimit("{$action['controller']}/{$action['action']}", 1, 5000)) {
|
|
|
|
- LogUtil::info('请求次数过多', $action['controller'], $action['action']);
|
|
|
|
|
|
+ if (!RedisUtil::getInstance(RedisKeyEnum::API_REQUEST_TRAFFIC)->requestLimit("{$action['controller']}/{$action['action']}", 1, 20000)) {
|
|
|
|
+ LogUtil::info('当前访问人数过多,请稍后再试', $action['controller'], $action['action']);
|
|
return $this->response206();
|
|
return $this->response206();
|
|
}
|
|
}
|
|
|
|
|