|
|
@ -218,6 +218,9 @@ public class PageController { |
|
|
if (null != userkey1 && userkey1.length() != 0 && null != usertoken1 && usertoken1.length() != 0 && null != sing1 && sing1.length() != 0 && null != time1 && time1.length() != 0){ |
|
|
if (null != userkey1 && userkey1.length() != 0 && null != usertoken1 && usertoken1.length() != 0 && null != sing1 && sing1.length() != 0 && null != time1 && time1.length() != 0){ |
|
|
long time1Long = Long.parseLong(time1); |
|
|
long time1Long = Long.parseLong(time1); |
|
|
long timeDifference = javaTime-time1Long; |
|
|
long timeDifference = javaTime-time1Long; |
|
|
|
|
|
System.out.println(javaTime); |
|
|
|
|
|
System.out.println(time1Long); |
|
|
|
|
|
System.out.println(timeDifference); |
|
|
// 将时间戳转换为LocalDateTime对象
|
|
|
// 将时间戳转换为LocalDateTime对象
|
|
|
LocalDateTime dateTime1 = LocalDateTime.ofInstant(Instant.ofEpochMilli(javaTime), ZoneId.systemDefault()); |
|
|
LocalDateTime dateTime1 = LocalDateTime.ofInstant(Instant.ofEpochMilli(javaTime), ZoneId.systemDefault()); |
|
|
LocalDateTime dateTime2 = LocalDateTime.ofInstant(Instant.ofEpochMilli(time1Long), ZoneId.systemDefault()); |
|
|
LocalDateTime dateTime2 = LocalDateTime.ofInstant(Instant.ofEpochMilli(time1Long), ZoneId.systemDefault()); |
|
|
@ -229,8 +232,12 @@ public class PageController { |
|
|
/*System.out.println(dateTime1); |
|
|
/*System.out.println(dateTime1); |
|
|
System.out.println(dateTime2); |
|
|
System.out.println(dateTime2); |
|
|
System.out.println(diffMillis);*/ |
|
|
System.out.println(diffMillis);*/ |
|
|
if(timeDifference<30000){//如果间隔时间不超过5秒
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(timeDifference<100000){//如果间隔时间不超过5秒
|
|
|
String singJava = Md5Util.md5InsensibleLogin(userkey1, usertoken1, time1); |
|
|
String singJava = Md5Util.md5InsensibleLogin(userkey1, usertoken1, time1); |
|
|
|
|
|
System.out.println("sing1---->"+sing1); |
|
|
|
|
|
System.out.println("singJava---->"+singJava); |
|
|
if(sing1.equals(singJava)){//校验通过允许无感登录
|
|
|
if(sing1.equals(singJava)){//校验通过允许无感登录
|
|
|
flag = true; |
|
|
flag = true; |
|
|
}else{ |
|
|
}else{ |
|
|
|