HighSpeaker/app/middleware/Throttle.php

26 lines
537 B
PHP
Raw Permalink Normal View History

2022-12-24 22:10:40 +08:00
<?php
/**
* 节流设置
* @copyright The PHP-Tools
*/
namespace app\middleware;
use Webman\MiddlewareInterface;
use Webman\Http\Response;
use Webman\Http\Request;
/**
* Class StaticFile
* @package app\middleware
*/
class Throttle implements MiddlewareInterface
{
public function process(Request $request, callable $next):Response
{
if ( $route = $request->route ) {
$params = $route->param();
}
return (new \yzh52521\middleware\Throttle())->handle($request, $next, $params??[]);
}
}