限制接口请求次数
github.com/Mitirrli/limit
Source
Issues
Installs: 116
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
Requires (Dev)
None
Suggests
Provides
Conflicts
Replaces
MIT 7d38fffa8059a4899a8b6c8cb9384edfa6dda723
This package is auto-updated.
Last update: 2024-12-06 21:26:18 UTC
🌈 基于redis的接口限制组件
$ composer require "mitirrli/limit"
$config = [ 'second' => 60,//多少秒 'num' => 50,//接口请求次数 'redis' => [//redis配置 ], ]; $limit = new Limit($config);//限制接口请求次数 if (!$limit->run()) return['1005', '当前接口请求次数已达上限,请稍后重试'];