- try {
- decodedJWT = verifier.verify(accessToken);
- } catch (JWTVerificationException e) {
- if (e instanceof TokenExpiredException || e instanceof InvalidClaimException) {
- // token超时的场景和AccessToken与当前公众号不一致的场景
- // 触发刷新AccessToken的操作
- log.info("登录令牌鉴权失败,令牌超时");
- return ResponseResult.Error(10001,"登录令牌鉴权失败,令牌超时");
- } else {
- // 签名失效的场景
- return ResponseResult.Error(10001,"登录令牌鉴权失败," + e.getMessage());
- }
- }