当前位置:网站首页>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',边栏推荐
- Installation and use of blue lake
- How much is the tuition fee of SCM training class? How long is the study time?
- Sword finger offer II 006 Sort the sum of two numbers in the array
- Handling of inconsistency between cursor and hinttext position in shutter textfield
- The 8th Blue Bridge Cup single chip microcomputer provincial competition
- The 9th Blue Bridge Cup single chip microcomputer provincial competition
- L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
- MySQL advanced SQL statement 2
- Introduction to vmware workstation and vSphere
- Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
猜你喜欢

JVM knowledge points

Installation et utilisation du lac bleu
![[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network](/img/11/4a8b52603e6e14a1ed6da1264dee57.png)
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network

Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf

毕设-基于SSM电影院购票系统

0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed

Didi open source Delta: AI developers can easily train natural language models

The 8th Blue Bridge Cup single chip microcomputer provincial competition

Go language introduction

Www2022 | know your way back: self training method of graph neural network under distribution and migration
随机推荐
集成底座方案演示说明
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
Go语言介绍
u本位合约爆仓清算解决方案建议
go 语言命名规范
The 9th Blue Bridge Cup single chip microcomputer provincial competition
BGP experiment the next day
Basic operations of MySQL database (based on tables)
[personal notes] PHP common functions - custom functions
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
How should the team choose the feature branch development mode or trunk development mode?
如何解决在editor模式下 无法删除物体的问题
手撕——排序
【IBDFE】基于IBDFE的频域均衡matlab仿真
【leetcode】74. Search 2D matrix
Dare to go out for an interview without learning some distributed technology?
树莓派GPIO引脚控制红绿灯与轰鸣器
Blue Bridge Cup single chip microcomputer sixth temperature recorder
Force buckle 540 A single element in an ordered array
10 minutes to understand CMS garbage collector in JVM