From 940e9a0814bac90ffc8b16127a18f87f52c91945 Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 30 Aug 2023 16:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EIP=E5=8F=91=E9=80=81=E9=A2=91?= =?UTF-8?q?=E7=B9=81=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Ems.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/api/controller/Ems.php b/application/api/controller/Ems.php index 7d39a12b..68f336cf 100644 --- a/application/api/controller/Ems.php +++ b/application/api/controller/Ems.php @@ -37,6 +37,12 @@ class Ems extends Api if ($last && time() - $last['createtime'] < 60) { $this->error(__('发送频繁')); } + + $ipSendTotal = \app\common\model\Ems::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count(); + if ($ipSendTotal >= 5) { + $this->error(__('发送频繁')); + } + if ($event) { $userinfo = User::getByEmail($email); if ($event == 'register' && $userinfo) {