public class QrCodeTotpUtil {
public static String generateTOTP(String seed){
- long X = 10;
+ long X = 5;
long T0 = 0;
String steps = "0";
long time = System.currentTimeMillis() / 1000;
}
public static String generateTOTP(String seed,String returnDigits){
- long X = 10;
+ long X = 5;
long T0 = 0;
String steps = "0";
long time = System.currentTimeMillis() / 1000;
public static boolean verifyCode(String totp, String secret, int offset) {
- String second = "10";
+ String second = "5";
long T0 = 0;
String[] keys = new String[offset * 2 + 1];
long time = System.currentTimeMillis() / 1000;
val qrcode = AesUtil.encryptCFB("$uid:$encdata", rootkey, iv, "AES/CFB/NoPadding")
val key = MD5.encodeByMD5ToURLSafeBase64(qrcode)
- redisTemplate.opsForValue().set(key,qrcode, Duration.ofMinutes(1))
+ redisTemplate.opsForValue().set(key,qrcode, Duration.ofSeconds(20))
resp.retcode = 0
resp.retmsg = key
return resp