作者 lyh

gx

@@ -33,18 +33,20 @@ class LoginAuthMiddleware @@ -33,18 +33,20 @@ class LoginAuthMiddleware
33 return response(['code'=> Code::USER_LOGIN_ERROE,'msg'=>'当前用户被禁用']); 33 return response(['code'=> Code::USER_LOGIN_ERROE,'msg'=>'当前用户被禁用']);
34 } 34 }
35 } 35 }
36 - $groupInfo = $this->getGroup($manage);  
37 - if($groupInfo['status'] != 1){  
38 - return response(['code'=> Code::USER_LOGIN_ERROE,'msg'=>'当前用户角色被禁用']);  
39 - }  
40 - //获取当前操作的路由name  
41 - $action = Route::currentRouteName();  
42 - //TODO::操作权限  
43 - $menuModel = new Menu();  
44 - $menu_id = $menuModel->read(['route_name'=>$action],['id']);  
45 - if($menu_id !== false){  
46 - if(in_array($menu_id['id'],$groupInfo['rights']) === false){  
47 - return response(['code'=>Code::USER_PERMISSION_ERROE,'msg'=>'当前用户没有权限']); 36 + if($manage['gid'] != 0){
  37 + $groupInfo = $this->getGroup($manage);
  38 + if($groupInfo['status'] != 1){
  39 + return response(['code'=> Code::USER_LOGIN_ERROE,'msg'=>'当前用户角色被禁用']);
  40 + }
  41 + //获取当前操作的路由name
  42 + $action = Route::currentRouteName();
  43 + //TODO::操作权限
  44 + $menuModel = new Menu();
  45 + $menu_id = $menuModel->read(['route_name'=>$action],['id']);
  46 + if($menu_id !== false){
  47 + if(in_array($menu_id['id'],$groupInfo['rights']) === false){
  48 + return response(['code'=>Code::USER_PERMISSION_ERROE,'msg'=>'当前用户没有权限']);
  49 + }
48 } 50 }
49 } 51 }
50 return $next($request); 52 return $next($request);