添加权限和权限表格的数据迁移文件
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{
|
||||
// //没有显示操作按钮的权限
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,13 @@ use app\common\controller\Base;
|
||||
// 引用与此控制器同名的数据模型
|
||||
use app\system\model\SystemBase as sysbasemod;
|
||||
|
||||
use think\auth\Auth;
|
||||
|
||||
class Index extends Base
|
||||
{
|
||||
//关闭自动时间
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 主页
|
||||
public function index()
|
||||
{
|
||||
@@ -52,10 +57,10 @@ class Index extends Base
|
||||
// 模版赋值
|
||||
$this->assign('list',$list);
|
||||
|
||||
// $url = url('welcome');
|
||||
// halt($url);
|
||||
|
||||
// 渲染输出
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-1
@@ -18,7 +18,8 @@
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"topthink/framework": "5.1.*",
|
||||
"topthink/think-migration": "^2.0"
|
||||
"topthink/think-migration": "^2.0",
|
||||
"5ini99/think-auth": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user