Explorar o código

Update Login.php

邹景立 %!s(int64=4) %!d(string=hai) anos
pai
achega
6fbc568de5
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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}]未定义规则!");
         }