添加中间件

This commit is contained in:
巴掌 committed 2018-10-12 16:57:30 +08:00
1 parent e70b4b120b
commit 6e1f870e21
5 files changed
+57 -18

No files matched your search

+5 -15
View File
@@ -11,22 +11,12 @@ use think\auth\Auth;
class Base extends Controller
{
// 当前类初始化
protected function initialize()
// 调用Auth中间件进行用户权限验证
protected $middleware = ['YanZheng'];
public function _empty()
{
$this->quanxianyanzheng();
$this->redirect('error/index/index');
}
protected function quanxianyanzheng()
{
// 实例化权限验证Auth类
$auth = new Auth();
// 检测权限
// if($auth->check('show_button',1)){// 第一个参数是规则名称,第二个参数是用户UID
// //有显示操作按钮的权限
// }else{
// //没有显示操作按钮的权限
// }
}
}