From 8677d13bb5a7adf5023e7f13c24918774c5099c5 Mon Sep 17 00:00:00 2001 From: zhaoxiang Date: Mon, 12 Oct 2020 15:21:04 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E5=96=84=E7=99=BB=E5=87=BA?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/middleware/AdminAuth.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,