-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
如下代码结果:
module:user
controller:
action:
controller和action是空的。
<?php
declare(strict_types=1);
namespace app\common\middleware;
use think\facade\Request;
class AuthHandle
{
public function handle($request, \Closure $next)
{
// 应用
$module = app('http')->getName();
// 控制器
$controller = Request::controller();
// 方法
$action = Request::action();
echo ('module:' . $module);
echo (PHP_EOL);
echo ('controller:' . $controller);
echo (PHP_EOL);
echo ('action:' . $action);
echo (PHP_EOL);
//
return $next($request);
}
}