modified 权限组数据区别超级管理员

This commit is contained in:
zhaoxiang 2018-02-24 14:55:36 +08:00
parent cae75e3e4c
commit 9f258582cd

View File

@ -62,13 +62,18 @@ class Login extends Base {
cache($userToken, json_encode($userInfo), config('apiAdmin.ONLINE_TIME'));
cache($userInfo['id'], $userToken, config('apiAdmin.ONLINE_TIME'));
$groups = ApiAuthGroupAccess::get(['uid' => $userInfo['id']]);
$return['access'] = 0;
if (isset($groups) || $groups->groupId) {
if (strpos($groups->groupId, ',') === false) {
$return['access'] = intval($groups->groupId);
} else {
$return['access'] = explode(',', $groups->groupId);
$return['access'] = 1000000;
$isSupper = Tools::isAdministrator($userInfo['id']);
if ($isSupper) {
$return['access'] = 0;
} else {
$groups = ApiAuthGroupAccess::get(['uid' => $userInfo['id']]);
if (isset($groups) || $groups->groupId) {
if (strpos($groups->groupId, ',') === false) {
$return['access'] = intval($groups->groupId);
} else {
$return['access'] = explode(',', $groups->groupId);
}
}
}