优化后台菜单生成

优化菜单写入字段
pull/406/head
Karson 2022-05-27 15:03:00 +08:00
parent 079f6df9dd
commit b3e172ddce
2 changed files with 2 additions and 2 deletions

View File

@ -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'] . '"',

View File

@ -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);