rabin 1 year ago
parent
commit
285f4abe17
2 changed files with 5 additions and 2 deletions
  1. 2 2
      api/Menu.php
  2. 3 0
      lib/Auth.php

+ 2 - 2
api/Menu.php

@@ -79,7 +79,7 @@ class Menu extends Auth
         $child = Dever::db('menu', 'manage')->select($where);
         if ($child) {
             foreach ($child as $v1) {
-                if (($v1['level'] == 3 || $v1['show'] != 1) && $this->checkMenu($v1['id'])) {
+                if ($v1['show'] <= 2 && $this->checkMenu($v1['id'])) {
                     continue;
                 }
                 if (!$parent) {
@@ -97,7 +97,7 @@ class Menu extends Auth
             $info['component'] = '@/dever/page/' . $v['path'];
         }
         if (!$child) {
-            if (($v['level'] == 3 || $v['show'] != 1) && $this->checkMenu($v['id'])) {
+            if ($v['show'] <= 2 && $this->checkMenu($v['id'])) {
                 return false;
             }
         }

+ 3 - 0
lib/Auth.php

@@ -118,6 +118,9 @@ class Auth
     protected function checkMenu($menu, $result = true)
     {
         if ($this->user['id'] == 1) {
+            if ($result) {
+                return false;
+            }
             return;
         }
         if ($this->user['auth']['menu'] && !Dever::check($this->user['auth']['menu'], $menu)) {