dever 7 년 전
부모
커밋
1a75e6a742
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/Auth.php
  2. 3 0
      src/Top.php

+ 4 - 2
src/Auth.php

@@ -112,7 +112,9 @@ class Auth
     {
         if ($state == true && Dever::config('base')->getAdmin && $info && isset($info['id'])) {
             $admin = Dever::db('manage/admin')->one($info['id']);
-            $info['top'] = $admin['top'];
+            if ($admin['top']) {
+                $info['top'] = $admin['top'];
+            }
         }
 
         if (!$info) {
@@ -304,7 +306,7 @@ class Auth
 
             if ($role) {
                 $user['oper'] = array();
-                $user['auth'] = '';
+                $user['auth'] = array();
                 $user['self'] = 2;
                 $top = array();
                 foreach ($role as $k => $v) {

+ 3 - 0
src/Top.php

@@ -65,10 +65,12 @@ class Top
             $child = Dever::db('manage/top')->child();
 
             foreach ($top as $k => $v) {
+                /*
                 if ($auth && strpos($auth, $k . '_') === false) {
                     unset($top[$k]);
                     continue;
                 }
+                */
 
                 if (isset($child[$v['id']])) {
                     # 如果已经保存了,就直接取出来吧
@@ -79,6 +81,7 @@ class Top
 
                     $c = 0;
                     foreach ($child[$v['id']] as $i => $j) {
+                        $i = str_replace('/', '-', $i);
                         if (($auth && strpos($auth, $i) === false) || ($info && $info['id'] == $j['id'])) {
 
                         } elseif (!$info && $c == 0) {