修改过期token返回码

This commit is contained in:
yanwenwu 2020-05-18 13:42:08 +08:00
parent 5057f3eb9e
commit 2361be7d71

View File

@ -17,7 +17,7 @@ class AuthTokenMiddleware extends Middleware
JWTAuth::auth(); JWTAuth::auth();
} catch (\Exception $e) { } catch (\Exception $e) {
if ($e instanceof TokenExpiredException) { if ($e instanceof TokenExpiredException) {
throw new FailedException('token 过期', Code::LOST_LOGIN); throw new FailedException('token 过期', Code::LOGIN_EXPIRED);
} }
if ($e instanceof TokenBlacklistException) { if ($e instanceof TokenBlacklistException) {
throw new FailedException('token 被加入黑名单', Code::LOST_LOGIN); throw new FailedException('token 被加入黑名单', Code::LOST_LOGIN);