Skip to content

Commit

Permalink
update: throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
falstack committed Jun 3, 2019
1 parent 15a4b41 commit 29ff023
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/v1/DoorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public function sendMessage(Request $request)
$phone = $request->get('phone_number');
$type = $request->get('type');

if ($this->checkMessageThrottle($phone))
{
return $this->resErrThrottle('一分钟内只能发送一次');
}

if ($type === 'sign_up')
{
$museNew = true;
Expand Down Expand Up @@ -95,11 +100,6 @@ public function sendMessage(Request $request)
return $this->resErrBad('未注册的手机号');
}

if ($this->checkMessageThrottle($phone))
{
return $this->resErrThrottle('一分钟内只能发送一次');
}

$authCode = $this->createMessageAuthCode($phone, $type);
$sms = new Message();

Expand Down

0 comments on commit 29ff023

Please sign in to comment.