添加权限和权限表格的数据迁移文件

This commit is contained in:
巴掌 committed 2018-10-10 17:01:28 +08:00
1 parent a96d656d1b
commit 401ce4724e
9 files changed
+231 -11

No files matched your search

+29 -2
View File
@@ -2,13 +2,40 @@
namespace app\common\controller;
// 引用控制器类
use think\Controller;
// 引用权限验证类
use think\auth\Auth;
// 引用软删除类
use think\model\concern\SoftDelete;
class Base extends Controller
{
//初始化
// 开启全局自动时间戳
protected $autoWriteTimestamp = true;
// 开启软删除
use SoftDelete;
protected $deleteTime = 'delete_time';
// 当前类初始化
protected function initialize()
{
$this->quanxianyanzheng();
}
protected function quanxianyanzheng()
{
// 实例化权限验证Auth类
$auth = new Auth();
// 检测权限
// if($auth->check('show_button',1)){// 第一个参数是规则名称,第二个参数是用户UID
// //有显示操作按钮的权限
// }else{
// //没有显示操作按钮的权限
// }
}
}