Browse Source

Update Login.php

邹景立 4 years ago
parent
commit
6fbc568de5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/data/controller/api/Login.php

+ 3 - 1
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}]未定义规则!");
         }