wesmiler 5 년 전
부모
커밋
13d813461c
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      app/Middleware/Auth/TokenMiddleware.php

+ 4 - 4
app/Middleware/Auth/TokenMiddleware.php

@@ -44,21 +44,21 @@ class TokenMiddleware implements MiddlewareInterface
             if (strlen($token) > 0) {
             if (strlen($token) > 0) {
                 $token = JWTUtil::handleToken($token);
                 $token = JWTUtil::handleToken($token);
                 if ($token == false || !$this->jwt->checkToken($token)) {
                 if ($token == false || !$this->jwt->checkToken($token)) {
-                    throw new TokenValidException(1005, 401);
+                    throw new TokenValidException(__('api.1005'), 401);
                 }
                 }
 
 
                 $authId = $token->getClaim('authId');
                 $authId = $token->getClaim('authId');
                 $user = User::where('id', $authId)->where(['enable'=> 'T'])->first();
                 $user = User::where('id', $authId)->where(['enable'=> 'T'])->first();
                 if(!$user){
                 if(!$user){
-                    throw new TokenValidException(1029, 401);
+                    throw new TokenValidException(__('api.1029'), 401);
                 }
                 }
             }else{
             }else{
                 //return ApiResource::failed(1010);
                 //return ApiResource::failed(1010);
-                throw new TokenValidException(1010, 401);
+                throw new TokenValidException(__('api.1010'), 401);
             }
             }
 
 
         } catch (\Exception $exception){
         } catch (\Exception $exception){
-            throw new TokenValidException(1006, 401);
+            throw new TokenValidException(__('api.1006'), 401);
         }
         }