cqpCow 1 year ago
parent
commit
7d0ac49cbf
1 changed files with 1 additions and 3 deletions
  1. 1 3
      app/Http/Middleware/CheckLogin.php

+ 1 - 3
app/Http/Middleware/CheckLogin.php

@@ -19,9 +19,7 @@ class CheckLogin
     public function handle($request, Closure $next)
     {
         $token=$request->header('Authorization');
-        if (!isset($token)){
-            return  response()->json(['code'=>1,'msg'=>'缺少token','data'=>null]);
-        }
+        if(empty($token)) return response()->json(['code'=>1,'msg'=>'缺少登录凭证','data'=>null]);
 
         //登录来源前缀清除
         foreach (LoginController::$port as $key => $value){