26 lines
474 B
PHP
26 lines
474 B
PHP
<?php
|
|
|
|
namespace app\http\middleware;
|
|
// 引用权限验证类
|
|
use think\auth\Auth;
|
|
use think\Controller;
|
|
|
|
class YanZheng extends Controller
|
|
{
|
|
public function handle($request, \Closure $next)
|
|
{
|
|
// 实例化权限验证类
|
|
$auth = new Auth();
|
|
|
|
|
|
if($auth->check('show_button',1)){// 第一个参数是规则名称,第二个参数是用户UID
|
|
dump('验证通过');
|
|
}else{
|
|
dump('验证不通过');
|
|
}
|
|
|
|
|
|
return $next($request);
|
|
}
|
|
}
|