From c9c185f552d1e70ef6591ab6866bedd4deff7108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 24 Feb 2021 10:35:14 +0800 Subject: [PATCH] Update Auth.php --- app/data/controller/api/Auth.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/data/controller/api/Auth.php b/app/data/controller/api/Auth.php index fe1ea6c8f..032c7298e 100644 --- a/app/data/controller/api/Auth.php +++ b/app/data/controller/api/Auth.php @@ -50,10 +50,9 @@ abstract class Auth extends Controller } // 获取用户数据 $this->user = $this->getUser(); - if (empty($this->user) || empty($this->user['id'])) { + $this->uuid = $this->user['id'] ?? ''; + if (empty($this->uuid)) { $this->error('用户登录失败!', '{-null-}', 401); - } else { - $this->uuid = $this->user['id']; } }