diff --git a/src/main/java/top/suyiiyii/sims/common/JwtInterceptor.java b/src/main/java/top/suyiiyii/sims/common/JwtInterceptor.java index 63b0254..10759c6 100644 --- a/src/main/java/top/suyiiyii/sims/common/JwtInterceptor.java +++ b/src/main/java/top/suyiiyii/sims/common/JwtInterceptor.java @@ -48,6 +48,8 @@ public class JwtInterceptor implements HandlerInterceptor { } } catch (TokenExpiredException e) { throw new ServiceException("401", "登录已过期,请重新登录"); + } catch (Exception e) { + throw new ServiceException("401", "token验证失败,请重新登录"); } // 获取 token 中的 user id Integer userId = Integer.parseInt(Objects.requireNonNull(JwtUtils.extractUserId(token)));