Althars123 3 лет назад
Родитель
Сommit
1fc641b9b1

+ 2 - 2
twzd-framework/src/main/java/com/miaxis/framework/interceptor/impl/SameUrlDataInterceptor.java

@@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
 /**
  * 判断请求url和数据是否和上一次相同,
  * 如果和上次相同,则是重复提交表单。 有效时间为10秒内。
- * 
+ *
  * @author miaxis
  */
 @Component
@@ -38,7 +38,7 @@ public class SameUrlDataInterceptor extends RepeatSubmitInterceptor
 
     /**
      * 间隔时间,单位:秒 默认10秒
-     * 
+     *
      * 两次相同参数的请求,如果间隔时间大于该参数,系统不会认定为重复提交的数据
      */
     private int intervalTime = 10;

+ 6 - 1
twzd-framework/src/main/java/com/miaxis/framework/web/service/TokenService.java

@@ -12,6 +12,7 @@ import eu.bitwalker.useragentutils.UserAgent;
 import io.jsonwebtoken.Claims;
 import io.jsonwebtoken.Jwts;
 import io.jsonwebtoken.SignatureAlgorithm;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
@@ -27,6 +28,7 @@ import java.util.concurrent.TimeUnit;
  * @author miaxis
  */
 @Component
+@Slf4j
 public class TokenService
 {
     // 令牌自定义标识
@@ -122,7 +124,10 @@ public class TokenService
     {
         long expireTime = loginUser.getExpireTime();
         long currentTime = System.currentTimeMillis();
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
+        long differTime = expireTime - currentTime;
+        Long differMinuts= differTime/(1000l*60);
+        log.info(differMinuts.toString());
+        if (differTime <= MILLIS_MINUTE_TEN)
         {
             refreshToken(loginUser);
         }