Browse Source

PC端权限菜单

lizhen_gitee 7 months ago
parent
commit
500f5121be
1 changed files with 9 additions and 1 deletions
  1. 9 1
      application/common/library/Authcompany.php

+ 9 - 1
application/common/library/Authcompany.php

@@ -557,6 +557,10 @@ class Authcompany extends \fast\Authpc
             ->select())->toArray();
 
         foreach ($ruleList as $k => &$v) {
+            $v['alwaysShow'] = true;
+            $v['keepAlive']  = true;
+            $v['visible']    = true;
+
             if (!in_array($v['namerule'], $userRule)) {
                 unset($ruleList[$k]);
                 continue;
@@ -576,12 +580,16 @@ class Authcompany extends \fast\Authpc
 
         // 必须将结果集转换为数组
         $ruleList = collection(\app\admin\model\PcAuthRule::where('status', 'normal')
-            ->field('id,pid as parentId,name as namerule,title as name,path,component,component_name,icon')
+            ->field('id,pid as parentId,name as namerule,title as name,path,component,component_name as componentName,icon')
             ->where('type',2)->where('pid',0)
             ->order('weigh', 'desc')
             ->select())->toArray();
 
         foreach ($ruleList as $k => &$v) {
+            $v['alwaysShow'] = true;
+            $v['keepAlive']  = true;
+            $v['visible']    = true;
+
             if (!in_array($v['namerule'], $userRule)) {
                 unset($ruleList[$k]);
                 continue;