wangliang hace 4 años
padre
commit
222d879aac

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

@@ -75,6 +75,10 @@ public class AuthInterceptor implements HandlerInterceptor {
                 if (Objects.isNull(tbSession)) {
                     throw new BusinessException(ExceptionResultEnum.LOGIN_NO);
                 } else {
+                    log.error("info.validate(tbSession.getAccessToken():{}", info.validate(tbSession.getAccessToken()));
+                    log.error("info.getTimestamp() < tbSession.getExpireTime():{}", info.getTimestamp() < tbSession.getExpireTime());
+                    log.error("platform.name().equalsIgnoreCase(tbSession.getPlatform()):{}", platform.name().equalsIgnoreCase(tbSession.getPlatform()));
+                    log.error("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());
@@ -122,9 +126,11 @@ public class AuthInterceptor implements HandlerInterceptor {
                     }
                 }
             } else {
+                log.error("SignatureInfo info is null");
                 throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
             }
         } else {
+            log.error("SystemConstant.expire(timestamp.longValue())", SystemConstant.expire(timestamp.longValue()));
             throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
         }
         response.setStatus(ExceptionResultEnum.SUCCESS.getCode());

+ 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.error("info.validate(tbSession.getAccessToken():{}", info.validate(tbSession.getAccessToken()));
+                    log.error("info.getTimestamp() < tbSession.getExpireTime():{}", info.getTimestamp() < tbSession.getExpireTime());
+                    log.error("platform.name().equalsIgnoreCase(tbSession.getPlatform()):{}", platform.name().equalsIgnoreCase(tbSession.getPlatform()));
+                    log.error("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.error("SignatureInfo info is null");
                 throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
             }
         } else {
+            log.error("SystemConstant.expire(timestamp.longValue())", SystemConstant.expire(timestamp.longValue()));
             throw new BusinessException(ExceptionResultEnum.AUTHORIZATION_ERROR);
         }
         response.setStatus(ExceptionResultEnum.SUCCESS.getCode());