当前位置:网站首页>Thinkphp6 interface limits user access frequency
Thinkphp6 interface limits user access frequency
2022-06-27 11:50:00 【Draw a flourishing fireworks with a black pencil】
$key = $request->ip()."_".$request->pathinfo().'_'.$id;
$check = Cache::store('file')->has($key);
if ($check) {
// +1
Cache::store('file')->inc($key);
$count = Cache::store('file')->get($key);
// Limit per minute 10 Time
if ($count > 10) {
json(['code'=>500,'msg'=>" Request frequency is too high "]);
}
} else {
Cache::store('file')->set($key, 1, 60);// Initial value 1
}边栏推荐
- [tcapulusdb knowledge base] Introduction to tcapulusdb analytical text export
- 杰理之睡眠以后定时唤醒系统继续跑不复位【篇】
- 21: Chapter 3: develop pass service: 4: further improve [send SMS, interface]; (in [send SMS, interface], call Alibaba cloud SMS service and redis service; a design idea: basecontroller;)
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- 内存四区(栈,堆,全局,代码区)
- R language uses the poisgof function of epidisplay package to test the goodness of fit of Poisson regression and whether there is overdispersion
- R language uses the polR function of mass package to construct the ordered multi classification logistic regression model, and uses the vglm function of VGAM package to test the parallelism hypothesis
- 【TcaplusDB知识库】TcaplusDB运维单据介绍
- 【TcaplusDB知识库】TcaplusDB系统用户组介绍
- R语言使用epiDisplay包的poisgof函数对泊松回归(Poisson Regression)执行拟合优度检验、检验是否存在过度离散问题(overdispersion)
猜你喜欢

"Internet +" contest topic hot docking | I figure to understand 38 propositions of Baidu

星际争霸的虫王IA退役2年搞AI,自叹不如了

JSP自定义标签

C語言0長度數組的妙用
![[tcapulusdb knowledge base] Introduction to tcapulusdb general documents](/img/04/b1194ca3340b23a4fb2091d1b2a44d.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents

Unity shader learning (II) the first shader

AutoCAD - three pruning methods
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area](/img/b7/2358e8cf1cdaeaba77e52d04cc74d4.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area

Challenges of machine learning system in production

alibaba jarslink
随机推荐
Unity shader learning (I) understanding the basic structure of unity shader
How to adjust an integer that is entered in Excel but always displays decimals?
千万不要错过,新媒体运营15个宝藏公众号分享
Code for structural design of proe/creo household appliances - electric frying pan
【TcaplusDB知识库】TcaplusDB数据导入介绍
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
【TcaplusDB知识库】TcaplusDB系统管理介绍
Deep understanding of happens before principle
Heap heap sort TOPK
Oracle multi table query
Precautions for use of IO interface interrupt of Jerry [chapter]
Leetcode 729. My schedule I (awesome, solved)
杰理之串口通信 串口接收IO需要设置数字功能【篇】
杰理之增加一个输入捕捉通道【篇】
"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?
Jerry's serial port communication serial port receiving IO needs to set digital function [chapter]
Detailed explanation of interprocess communication
Matlab exercises - create 50 rows and 50 columns of all zero matrix, all 1 matrix, identity matrix, diagonal matrix, and output the 135 element of the matrix.
[tcapulusdb knowledge base] tcapulusdb business data backup introduction
干货!零售业智能化管理会遇到哪些问题?看懂这篇文章就够了