cqpCow 9 months ago
parent
commit
5bb5c28e93
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]);
 
         //校验token
         $result = TokenService::verifyToken($token);