当前位置:网站首页>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',边栏推荐
- pip 安装第三方库
- SQL Yiwen get window function
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验2 蜂鸣器实验(学习笔记)
- [source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
- Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
- The original author is out! Faker. JS has been controlled by the community..
- XSS prevention
- 【IBDFE】基于IBDFE的频域均衡matlab仿真
- 【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
- Suggestions on settlement solution of u standard contract position explosion
猜你喜欢

软件测试人的第一个实战项目:web端(视频教程+文档+用例库)

pip 安装第三方库

藍湖的安裝及使用

【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
![[JS event -- event flow]](/img/fe/199890b082845f68b65f25056e6f29.jpg)
[JS event -- event flow]

Dare to go out for an interview without learning some distributed technology?

云服务器的安全设置常识

Go language introduction

"No war on the Western Front" we just began to love life, but we had to shoot at everything

The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
随机推荐
Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
Wpviewpdf Delphi and Net PDF viewing component
[JS -- map string]
【leetcode】74. Search 2D matrix
Didi open source Delta: AI developers can easily train natural language models
Visual slam Lecture 3 -- Lie groups and Lie Algebras
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
Bitmap principle code record
树莓派GPIO引脚控制红绿灯与轰鸣器
Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
手撕——排序
Opencv learning example code 3.2.4 LUT
Blue Bridge Cup single chip microcomputer sixth temperature recorder
How to solve the code error when storing array data into the database
WPViewPDF Delphi 和 .NET 的 PDF 查看组件
JVM知识点
C language: examples of logical operation and judgment selection structure
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs