|
@@ -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);
|
|
|
}
|