|
|
@@ -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);
|
|
|
// 获取当前角色所有权限链接
|