修复sidebar左侧菜单因大小写问题导致的菜单列表不能正确显示问题

当手动添加菜单规则时, 规则字段未提示和处理用户录入的字符
在application/admin/library/Auth.php -> getSidebar方法中, 会对当前用户所拥有的权限节点做校验移除不相关的权限
当判断当前菜单规则是否在$userRule中时, 原本的$v['name']为直接从数据库中取出未做处理, $userRule则是通过$this->getRuleList方法获取, 方法内已经对字符串做了转小写处理, 假如用户填写了大小写混合的规则, 则此处将会被错误的移除掉; 导致左侧菜单无法正常展示该菜单规则;

Signed-off-by: AriFe.Liu <88468560@qq.com>
pull/470/head
AriFe.Liu 2024-07-23 03:33:44 +00:00 committed by Gitee
parent ac25e4b275
commit 271596ee2d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -472,7 +472,7 @@ class Auth extends \fast\Auth
->column('name,pid');
$pidArr = array_unique(array_filter(array_column($ruleList, 'pid')));
foreach ($ruleList as $k => &$v) {
if (!in_array($v['name'], $userRule)) {
if (!in_array(strtolower($v['name']), $userRule)) {
unset($ruleList[$k]);
continue;
}