Commit 45b64a15 by 杨树贤

权限修复

parent 51f507bb
Showing with 2 additions and 1 deletions
...@@ -42,7 +42,7 @@ class Permission ...@@ -42,7 +42,7 @@ class Permission
$request->perms = $perms; $request->perms = $perms;
} }
if (!in_array($user->userId, $permData['admin_group']) && $action != 'Dashboard') {//不是超级管理员 if (!in_array($user->userId, $permData['admin_group']) && $action != 'Dashboard') {//不是超级管理员
$perm = $this->perm($request->user->userId, $action); $perm = $this->perm($request->user->userId, strtolower($action));
if ($perm !== true) { if ($perm !== true) {
if ($isApi) { if ($isApi) {
return '没有权限'; return '没有权限';
...@@ -143,6 +143,7 @@ class Permission ...@@ -143,6 +143,7 @@ class Permission
if ((!in_array($perm, $notAuth)) && !in_array($userId, $AdminID)) {//过滤不用鉴权的方法与用户 if ((!in_array($perm, $notAuth)) && !in_array($userId, $AdminID)) {//过滤不用鉴权的方法与用户
$permID = $permArr['id']; $permID = $permArr['id'];
$url = $permArr['url'] . '/' . $userId . '/' . $permID . '?perms=' . $perm; $url = $permArr['url'] . '/' . $userId . '/' . $permID . '?perms=' . $perm;
dd($url);
$result = json_decode(curl($url, '', 0), true); $result = json_decode(curl($url, '', 0), true);
if (!isset($result['retcode']) || $result['retcode'] !== 0 || $result['data']['perms'][$perm] == false) { if (!isset($result['retcode']) || $result['retcode'] !== 0 || $result['data']['perms'][$perm] == false) {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment