first
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
'capacity' => 60, // The number of requests the "bucket" can hold
|
||||
'seconds' => 60, // The time it takes the "bucket" to completely refill
|
||||
'cost' => 1, // The number of tokens this action uses.
|
||||
'customer_handle' => [
|
||||
'class' => \support\Response::class,
|
||||
'constructor' => [
|
||||
429,
|
||||
array(),
|
||||
json_encode(['success' => false, 'msg' => '请求次数太频繁'], 256),
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
'' => [
|
||||
\NspTeam\WebmanThrottler\Middleware\ThrottlerMiddleware::class,
|
||||
]
|
||||
];
|
||||
Reference in New Issue
Block a user