Bläddra i källkod

优化后台菜单生成

优化菜单写入字段
Karson 3 år sedan
förälder
incheckning
b3e172ddce
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      application/admin/library/Auth.php
  2. 1 1
      application/common/library/Menu.php

+ 1 - 1
application/admin/library/Auth.php

@@ -476,7 +476,7 @@ class Auth extends \fast\Auth
                 );
                 $current = in_array($item['id'], $selectParentIds);
                 $url = $childList ? 'javascript:;' : $item['url'];
-                $addtabs = $childList || !$url ? "" : (stripos($url, "?") !== false ? "&" : "?") . "ref=addtabs";
+                $addtabs = $childList || !$url ? "" : (stripos($url, "?") !== false ? "&" : "?") . "ref=" . ($item['menutype'] ? $item['menutype'] : 'addtabs');
                 $childList = str_replace(
                     '" pid="' . $item['id'] . '"',
                     ' ' . ($current ? '' : 'hidden') . '" pid="' . $item['id'] . '"',

+ 1 - 1
application/common/library/Menu.php

@@ -182,7 +182,7 @@ class Menu
         } else {
             $pid = $parent;
         }
-        $allow = array_flip(['file', 'name', 'title', 'icon', 'condition', 'remark', 'ismenu', 'weigh']);
+        $allow = array_flip(['file', 'name', 'title', 'url', 'icon', 'condition', 'remark', 'ismenu', 'menutype', 'extend', 'weigh']);
         foreach ($newMenu as $k => $v) {
             $hasChild = isset($v['sublist']) && $v['sublist'] ? true : false;
             $data = array_intersect_key($v, $allow);