当前位置:网站首页>Thinkphp6 limit interface access frequency
Thinkphp6 limit interface access frequency
2022-07-02 04:05:00 【Minced pork, pumpkin and scallop】
Install expansion pack
composer require topthink/think-throttle
stay config/throttle.php
configuration option :
// Cache key prefix , Prevent key values from conflicting with other applications
'prefix' => 'throttle_',
// The cache keys ,true Indicates the source of use ip
'key' => function($throttle, $request) {
$user_id=$request->user_id;
return '__CONTROLLER__/__ACTION__/__IP__'.$user_id;
},
// The type of request to be restricted , eg: GET POST PUT DELETE HEAD etc.
'visit_method' => ['GET', 'HEAD'],
// Set access frequency , for example '10/m' It means allowing requests per minute 10 Time ;'10/60' Means that every 60 Second request 10 Time . value null Means unrestricted , eg: null 10/m 20/h 300/d 200/300
'visit_rate' => '5/m',
边栏推荐
- QT designer plug-in implementation of QT plug-in
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- [untitled]
- Basic operations of MySQL database (based on tables)
- The 8th Blue Bridge Cup single chip microcomputer provincial competition
- 如何解决在editor模式下 无法删除物体的问题
- Uni app - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
- JVM知识点
- How should the team choose the feature branch development mode or trunk development mode?
- How to solve the problem that objects cannot be deleted in Editor Mode
猜你喜欢
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
Realizing deep learning framework from zero -- Introduction to neural network
2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
Go语言介绍
The confusion I encountered when learning stm32
【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
随机推荐
How to solve the code error when storing array data into the database
Monkey test
Blue Bridge Cup single chip microcomputer sixth temperature recorder
go 函数
一文彻底理解评分卡开发中——Y的确定(Vintage分析、滚动率分析等)
Use a mask to restrict the input of the qlineedit control
Delete the code you wrote? Sentenced to 10 months!
Three ways for programmers to learn PHP easily and put chaos out of order
SQL Yiwen get window function
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
2022-07-01: at the annual meeting of a company, everyone is going to play a game of giving bonuses. There are a total of N employees. Each employee has construction points and trouble points. They nee
Where can I buy cancer insurance? Which product is better?
向数据库中存入数组数据,代码出错怎么解决
Flutter中深入了解MaterialApp,常用属性解析
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
go 分支与循环
C language: examples of logical operation and judgment selection structure
XSS prevention