1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-19 18:43:04 +08:00
2020-04-09 18:44:46 +08:00

26 lines
535 B
PHP

<?php
namespace App\Http\Api\Controllers;
use App\Traits\Response as ResponseTrait;
use App\Traits\Security as SecurityTrait;
use Phalcon\Mvc\Dispatcher;
class Controller extends \Phalcon\Mvc\Controller
{
use ResponseTrait, SecurityTrait;
public function beforeExecuteRoute(Dispatcher $dispatcher)
{
if (!$this->checkRateLimit()) {
$dispatcher->forward([
'controller' => 'public',
'action' => 'throttle',
]);
return false;
}
}
}