mirror of https://gitee.com/karson/fastadmin.git
新增IP发送频繁检测
parent
901bea7d59
commit
940e9a0814
|
|
@ -37,6 +37,12 @@ class Ems extends Api
|
||||||
if ($last && time() - $last['createtime'] < 60) {
|
if ($last && time() - $last['createtime'] < 60) {
|
||||||
$this->error(__('发送频繁'));
|
$this->error(__('发送频繁'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ipSendTotal = \app\common\model\Ems::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count();
|
||||||
|
if ($ipSendTotal >= 5) {
|
||||||
|
$this->error(__('发送频繁'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($event) {
|
if ($event) {
|
||||||
$userinfo = User::getByEmail($email);
|
$userinfo = User::getByEmail($email);
|
||||||
if ($event == 'register' && $userinfo) {
|
if ($event == 'register' && $userinfo) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue