更新至5.1.27LTS,编写权限,在添加用户时直接添加角色

This commit is contained in:
巴掌 committed 2018-10-24 16:08:03 +08:00
1 parent 378b60cbf6
commit f4f4fe1d67
39 files changed
+535 -367

No files matched your search

+3 -2
View File
@@ -39,11 +39,12 @@ class YanZheng extends Controller
// 实例化权限验证类
$auth = new Auth();
// 获取当前地址
$mod = $request->module();
$con = $request->controller();
$act = $request->action();
$url = $request->module().'/'.$request->controller().'/'.$request->action();
$url = $mod.'/'.$con.'/'.$act;
// 排除模块
$uneed_m = array('home');
@@ -63,7 +64,7 @@ class YanZheng extends Controller
}
// 验证方法
if( !$auth->check($url, $yz ) && $except == false ){// 第一个参数是规则名称,第二个参数是用户UID
if( !$auth->check($url, session('userid')) && $except == false ){// 第一个参数是规则名称,第二个参数是用户UID
$this->error('哎哟~ 权限不足');
}