当前位置:网站首页>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',边栏推荐
- LCM of Spreadtrum platform rotates 180 °
- SQL:常用的 SQL 命令
- Blue Bridge Cup single chip microcomputer sixth temperature recorder
- 【c语言】动态规划---入门到起立
- Suggestions on settlement solution of u standard contract position explosion
- Basic operations of MySQL database (based on tables)
- [untitled]
- Dare to go out for an interview without learning some distributed technology?
- 如何解决在editor模式下 无法删除物体的问题
- Www2022 | know your way back: self training method of graph neural network under distribution and migration
猜你喜欢
![[personal notes] PHP common functions - custom functions](/img/3d/d50622e3ddb08f654f30063e8226ac.jpg)
[personal notes] PHP common functions - custom functions

BiShe cinema ticket purchasing system based on SSM

Go language introduction

First acquaintance with string+ simple usage (II)

Interface debugging tool simulates post upload file - apipost

【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)

Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
![[JS event -- event flow]](/img/fe/199890b082845f68b65f25056e6f29.jpg)
[JS event -- event flow]

藍湖的安裝及使用

【leetcode】74. Search 2D matrix
随机推荐
树莓派GPIO引脚控制红绿灯与轰鸣器
cookie、session、tooken
MySQL advanced SQL statement 2
Target free or target specific: a simple and effective zero sample position detection comparative learning method
Go语言介绍
如何解决在editor模式下 无法删除物体的问题
Vite: configure IP access
Li Kou interview question 02.08 Loop detection
SQL Yiwen get window function
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
Monkey测试
Fluent icon demo
The fourth provincial competition of Bluebridge cup single chip microcomputer
Use of go package
Dare to go out for an interview without learning some distributed technology?
Fingertips life Chapter 4 modules and packages
"No war on the Western Front" we just began to love life, but we had to shoot at everything
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
Microsoft Research Institute's new book "Fundamentals of data science", 479 Pages pdf
Feature Engineering: summary of common feature transformation methods