d671b463 by Zelig

登陆权限bug

1 parent d8b678f2
......@@ -24,15 +24,12 @@ if(!function_exists('hasRole')) {
function hasRole($roles = []) {
$CI = &get_instance();
$CI->load->helper('cookie');
$login_user = get_cookie('login_user');
if($login_user) {
$login_user = json_decode($login_user, true);
foreach($login_user['roleKeys'] as $v){
$login_user = api('system/user/loginUser');
foreach($login_user->roleKeys as $v){
if(in_array($v, $roles)){
return true;
}
}
return false;
}
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!