From 63f53710fb7c29d28f72bf2b03266459cbd84a3b Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 24 Nov 2020 18:26:58 +0800 Subject: [PATCH] Update Auth.php --- app/data/controller/api/Auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/data/controller/api/Auth.php b/app/data/controller/api/Auth.php index 0d53828a1..e65a7eb59 100644 --- a/app/data/controller/api/Auth.php +++ b/app/data/controller/api/Auth.php @@ -29,14 +29,13 @@ abstract class Auth extends Controller * 当前接口类型 * @var string */ - protected $type = 'wxapp'; + protected $type; /** * 控制器初始化 */ protected function initialize() { - $this->type = input('api', 'web'); $this->user = $this->getUser(); $this->uuid = $this->user['id']; } @@ -49,6 +48,7 @@ abstract class Auth extends Controller { try { $user = UserService::instance(); + $this->type = input('api', 'web'); if (empty($this->uuid)) { $token = input('token') ?: $this->request->header('token'); if (empty($token)) $this->error('接口认证令牌不能为空!');