添加权限和权限表格的数据迁移文件
This commit is contained in:
1 parent
a96d656d1b
commit
401ce4724e
9 files changed
+231
-11
No files matched your search
@@ -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{
|
||||
// //没有显示操作按钮的权限
|
||||
// }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user