From 6fbc568de53b2d38923de1dc2d1449f209e4071e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 25 Mar 2021 18:56:41 +0800 Subject: [PATCH] Update Login.php --- app/data/controller/api/Login.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/data/controller/api/Login.php b/app/data/controller/api/Login.php index 50b6e58a6..4ccc4551e 100644 --- a/app/data/controller/api/Login.php +++ b/app/data/controller/api/Login.php @@ -30,7 +30,9 @@ class Login extends Controller */ protected function initialize() { - $this->type = input('api', UserAdminService::API_TYPE_WAP); + $this->type = $this->request->header('api-name', input('api')); + $this->type = $this->type ?: $this->request->header('api-type'); + $this->type = $this->type ?: UserAdminService::API_TYPE_WAP; if (empty(UserAdminService::TYPES[$this->type])) { $this->error("接口支付[{$this->type}]未定义规则!"); }