diff --git a/app/middleware/AdminAuth.php b/app/middleware/AdminAuth.php index 71dfd9d..0d03a90 100644 --- a/app/middleware/AdminAuth.php +++ b/app/middleware/AdminAuth.php @@ -20,7 +20,9 @@ class AdminAuth { $ApiAuth = $request->header('Api-Auth', ''); if ($ApiAuth) { $userInfo = cache('Login:' . $ApiAuth); - $userInfo = json_decode($userInfo, true); + if ($userInfo) { + $userInfo = json_decode($userInfo, true); + } if (!$userInfo || !isset($userInfo['id'])) { return json([ 'code' => ReturnCode::AUTH_ERROR,