Pārlūkot izejas kodu

Update Login.php

邹景立 4 gadi atpakaļ
vecāks
revīzija
6fbc568de5
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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}]未定义规则!");
         }