diff --git a/app/api/ApiController.php b/app/api/ApiController.php index db3802e..3d4d77e 100644 --- a/app/api/ApiController.php +++ b/app/api/ApiController.php @@ -147,8 +147,8 @@ abstract class ApiController protected function checkAuth() { $uid = JWT_UID; - $login_admin = Db::name('Admin')->where(['id' => $uid])->find(); - if(!$login_admin['status']){ + $loginAdmin = Db::name('Admin')->where(['id' => $uid])->find(); + if(!$loginAdmin['status']){ $this->apiError('用户已禁止登录'); } $baseUrl = explode('/', request()->baseUrl()); @@ -157,12 +157,12 @@ abstract class ApiController $controllerArray = explode('_', $controller); $prefixMod = strtolower($controllerArray[0] ?? '-'); $conMod = strtolower($controllerArray[1] ?? '-'); - $GOUGU = new Systematic(); - $GOUGU->auth($uid); - $auth_list_all = Cache::get('RulesSrc0'); - $auth_list = Cache::get('RulesSrc' . $uid); + $gougu = new Systematic(); + $gougu->auth($uid); + $authListAll = Cache::get('RulesSrc0'); + $authList = Cache::get('RulesSrc' . $uid); $pathUrl = $prefixMod . '/' . $conMod . '/' . $action; - if (!in_array($pathUrl, $auth_list)) { + if (!in_array($pathUrl, $authList)) { $this->apiError('用户无权限'); } }