wesmiler 3 năm trước cách đây
mục cha
commit
7e4e2a2dda
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      source/application/store/service/Auth.php

+ 3 - 2
source/application/store/service/Auth.php

@@ -125,7 +125,7 @@ class Auth
     private function checkAccess($url)
     {
         // 超级管理员无需验证
-        if ($this->user['is_super']) {
+        if ($this->user && $this->user['is_super']) {
             return true;
         }
         // 验证当前请求是否在白名单
@@ -157,7 +157,8 @@ class Auth
     {
         if (empty($this->accessUrls)) {
             // 获取当前用户的角色集
-            $roleIds = UserRole::getRoleIds($this->user['store_user_id']);
+            $storeUserId = isset($this->user['store_user_id'])? $this->user['store_user_id'] : 0;
+            $roleIds = UserRole::getRoleIds($storeUserId);
             // 根据已分配的权限
             $accessIds = RoleAccess::getAccessIds($roleIds);
             // 获取当前角色所有权限链接