lgy 2 months ago
parent
commit
6d19f7e3cb
2 changed files with 4 additions and 4 deletions
  1. 3 3
      jcjyhr/app/common/controller/ApiController.php
  2. 1 1
      jcjyhr/route/route.php

+ 3 - 3
jcjyhr/app/common/controller/ApiController.php

@@ -36,7 +36,7 @@ class ApiController extends Api
             $this->tokenData = $data;
             if(empty($data))
             {
-                $this->error('无效的token');
+//                $this->error('无效的token');
             }
         }
 
@@ -78,9 +78,9 @@ class ApiController extends Api
     public function getHeaderToken(): string
     {
         $header = getallheaders();
-        $auth = $header['Authorization'];
+        $auth = $header['Authorization'] ?? '';
         $data = explode(' ',$auth);
-        return $data[1];
+        return $data[1] ?? '';
     }
 
 }

+ 1 - 1
jcjyhr/route/route.php

@@ -10,7 +10,7 @@ use think\facade\route;
 // | Author: liu21st <liu21st@gmail.com>
 // +----------------------------------------------------------------------
 
-Route::post('basic-api/getToken', '/zskk/api/getToken');
+Route::post('basic-api/getToken', 'app\zskk\controller\api/getToken');
 return [
 
 ];