laravel 接口请求频次限制

时间:2021-09-03 22:56:51   收藏:0   阅读:32
Cache::put(‘x‘,Cache::get(‘x‘)+1,1440);

if(Cache::get(‘x‘)>5){
return [‘code‘=>205,‘data‘=>‘‘,‘msg‘=>‘请求次数过于频繁‘];
}



中间件


throttle:次数,时间

原文:https://www.cnblogs.com/aguo/p/15221564.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!