Browse Source

鉴权log

wangliang 4 years ago
parent
commit
b7a58d2b0f

+ 6 - 0
themis-exam/src/main/java/com/qmth/themis/exam/interceptor/AuthInterceptor.java

@@ -77,6 +77,10 @@ public class AuthInterceptor implements HandlerInterceptor {
                 if (Objects.isNull(tbSession)) {
                     throw new BusinessException(ExceptionResultEnum.LOGIN_NO);
                 } else {
+                    log.info("info.validate(tbSession.getAccessToken():{}", info.validate(tbSession.getAccessToken()));
+                    log.info("info.getTimestamp() < tbSession.getExpireTime():{}", info.getTimestamp() < tbSession.getExpireTime());
+                    log.info("platform.name().equalsIgnoreCase(tbSession.getPlatform()):{}", platform.name().equalsIgnoreCase(tbSession.getPlatform()));
+                    log.info("Objects.equals(deviceId, tbSession.getDeviceId()):{}", Objects.equals(deviceId, tbSession.getDeviceId()));
                     if (info.validate(tbSession.getAccessToken()) && info.getTimestamp() < tbSession.getExpireTime()
                             && platform.name().equalsIgnoreCase(tbSession.getPlatform()) && Objects.equals(deviceId, tbSession.getDeviceId())) {
                         userId = Long.parseLong(tbSession.getIdentity());
@@ -126,9 +130,11 @@ public class AuthInterceptor implements HandlerInterceptor {
                     }
                 }
             } else {
+                log.info("SignatureInfo info is null");
                 throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
             }
         } else {
+            log.info("SystemConstant.expire(timestamp.longValue()):{}", SystemConstant.expire(timestamp.longValue()));
             throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
         }
         response.setStatus(ExceptionResultEnum.SUCCESS.getCode());