记得上下班打卡 | git大法好,push需谨慎

Commit a182a6ef authored by 张国柄's avatar 张国柄

~api:NFT安全密码校验不通过文案调整;

parent 67e4ac7b
...@@ -199,10 +199,10 @@ public class GoblinUserDigitalArtworkController { ...@@ -199,10 +199,10 @@ public class GoblinUserDigitalArtworkController {
return ResponseDto.failure(ErrorMapping.get("140105"));// 藏品不存在 return ResponseDto.failure(ErrorMapping.get("140105"));// 藏品不存在
} }
if (userDigitalArtworkVo.getTransferAt().plusDays(1).isBefore(LocalDateTime.now())) { if (userDigitalArtworkVo.getTransferAt().plusDays(1).isBefore(LocalDateTime.now())) {
return ResponseDto.failure(ErrorMapping.get("140117"));// 已过转赠领取有效期 return ResponseDto.failure(ErrorMapping.get("140118"));// 已过转赠领取有效期
} }
if (!GoblinStatusConst.TransferState.WAITING.name().equals(userDigitalArtworkVo.getTransferState())) { if (!GoblinStatusConst.TransferState.WAITING.name().equals(userDigitalArtworkVo.getTransferState())) {
return ResponseDto.failure(ErrorMapping.get(null == userDigitalArtworkVo.getTransferState() ? "140119" : "140118"));// 藏品已领取或已退还 return ResponseDto.failure(ErrorMapping.get(null == userDigitalArtworkVo.getTransferState() ? "140120" : "140119"));// 藏品已领取或已退还
} }
if (!goblinRedisUtils.lockUserDigitalArtworkVoOperate(artworkId)) return ResponseDto.failure(ErrorMapping.get("140000")); if (!goblinRedisUtils.lockUserDigitalArtworkVoOperate(artworkId)) return ResponseDto.failure(ErrorMapping.get("140000"));
boolean transferReceiveRstFlg = goblinUserDigitalArtworkService.transferConfirmReceive(artworkId); boolean transferReceiveRstFlg = goblinUserDigitalArtworkService.transferConfirmReceive(artworkId);
...@@ -223,7 +223,7 @@ public class GoblinUserDigitalArtworkController { ...@@ -223,7 +223,7 @@ public class GoblinUserDigitalArtworkController {
return ResponseDto.failure(ErrorMapping.get("140105"));// 藏品不存在 return ResponseDto.failure(ErrorMapping.get("140105"));// 藏品不存在
} }
if (!GoblinStatusConst.TransferState.WAITING.name().equals(userDigitalArtworkVo.getTransferState())) { if (!GoblinStatusConst.TransferState.WAITING.name().equals(userDigitalArtworkVo.getTransferState())) {
return ResponseDto.failure(ErrorMapping.get(null == userDigitalArtworkVo.getTransferState() ? "140119" : "140118"));// 藏品已领取 return ResponseDto.failure(ErrorMapping.get(null == userDigitalArtworkVo.getTransferState() ? "140120" : "140119"));// 藏品已领取
} }
if (!goblinRedisUtils.lockUserDigitalArtworkVoOperate(artworkId)) return ResponseDto.failure(ErrorMapping.get("140000")); if (!goblinRedisUtils.lockUserDigitalArtworkVoOperate(artworkId)) return ResponseDto.failure(ErrorMapping.get("140000"));
boolean transferReceiveRstFlg = goblinUserDigitalArtworkService.transferConfirmReturn(artworkId); boolean transferReceiveRstFlg = goblinUserDigitalArtworkService.transferConfirmReturn(artworkId);
......
...@@ -2755,8 +2755,8 @@ public class GoblinRedisUtils { ...@@ -2755,8 +2755,8 @@ public class GoblinRedisUtils {
long expire = redisUtil.getExpire(GoblinRedisConst.USER_SAFE_LK_PASSWDTL.concat(uid)); long expire = redisUtil.getExpire(GoblinRedisConst.USER_SAFE_LK_PASSWDTL.concat(uid));
ErrorMapping.ErrorMessage errorMessage; ErrorMapping.ErrorMessage errorMessage;
if (expire > 0) { if (expire > 0) {
errorMessage = ErrorMapping.get("140113"); errorMessage = ErrorMapping.get("140117");
return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), expire / 60 + 1)); return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), this.getUserSafeLkPasswdtlTimelimit()));
} }
long validFailedNum = redisUtil.incr(GoblinRedisConst.USER_SAFE_LK_PASSWD.concat(uid), 1); long validFailedNum = redisUtil.incr(GoblinRedisConst.USER_SAFE_LK_PASSWD.concat(uid), 1);
if (validFailedNum <= 5) { if (validFailedNum <= 5) {
...@@ -2765,25 +2765,19 @@ public class GoblinRedisUtils { ...@@ -2765,25 +2765,19 @@ public class GoblinRedisUtils {
return ResponseDto.success(); return ResponseDto.success();
} }
} }
LocalDateTime currentDateTime, tomorrowStartDateTime;
Integer passwdtlTimelimit; Integer passwdtlTimelimit;
LocalDateTime currentDateTime, tomorrowStartDateTime;
switch (Math.toIntExact(validFailedNum)) { switch (Math.toIntExact(validFailedNum)) {
case 1: case 1:
currentDateTime = LocalDateTime.now(); currentDateTime = LocalDateTime.now();
tomorrowStartDateTime = currentDateTime.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); tomorrowStartDateTime = currentDateTime.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0);
redisUtil.expireSet(GoblinRedisConst.USER_SAFE_LK_PASSWD, ChronoUnit.SECONDS.between(currentDateTime, tomorrowStartDateTime)); redisUtil.expireSet(GoblinRedisConst.USER_SAFE_LK_PASSWD, ChronoUnit.SECONDS.between(currentDateTime, tomorrowStartDateTime));
case 2: case 2:
passwdtlTimelimit = (Integer) redisUtil.get(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT); passwdtlTimelimit = this.getUserSafeLkPasswdtlTimelimit();
if (null == passwdtlTimelimit) {
redisUtil.set(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT, passwdtlTimelimit = 30);
}
errorMessage = ErrorMapping.get("140116"); errorMessage = ErrorMapping.get("140116");
return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), 3 - validFailedNum, passwdtlTimelimit)); return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), 3 - validFailedNum, passwdtlTimelimit));
case 3: case 3:
passwdtlTimelimit = (Integer) redisUtil.get(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT); passwdtlTimelimit = this.getUserSafeLkPasswdtlTimelimit();
if (null == passwdtlTimelimit) {
redisUtil.set(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT, passwdtlTimelimit = 30);
}
redisUtil.set(GoblinRedisConst.USER_SAFE_LK_PASSWDTL.concat(uid), 1, passwdtlTimelimit * 60);// 30分钟后可继续尝试第4、5次 redisUtil.set(GoblinRedisConst.USER_SAFE_LK_PASSWDTL.concat(uid), 1, passwdtlTimelimit * 60);// 30分钟后可继续尝试第4、5次
errorMessage = ErrorMapping.get("140113"); errorMessage = ErrorMapping.get("140113");
return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), passwdtlTimelimit)); return ResponseDto.failure(errorMessage.getCode(), String.format(errorMessage.getMessage(), passwdtlTimelimit));
...@@ -2796,6 +2790,14 @@ public class GoblinRedisUtils { ...@@ -2796,6 +2790,14 @@ public class GoblinRedisUtils {
} }
} }
private Integer getUserSafeLkPasswdtlTimelimit() {
Integer passwdtlTimelimit = (Integer) redisUtil.get(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT);
if (null == passwdtlTimelimit) {
redisUtil.set(GoblinRedisConst.USER_SAFE_LK_PASSWDTL_TIMELIMIT, passwdtlTimelimit = 30);
}
return passwdtlTimelimit;
}
/* ---------------------------------------- ---------------------------------------- */ /* ---------------------------------------- ---------------------------------------- */
/** /**
......
...@@ -59,9 +59,10 @@ ...@@ -59,9 +59,10 @@
140114=\u5BC6\u7801\u9519\u8BEF\uFF0C\u518D\u8F93\u95191\u6B21\u8BF7\u8054\u7CFB\u5BA2\u670D\u627E\u56DE 140114=\u5BC6\u7801\u9519\u8BEF\uFF0C\u518D\u8F93\u95191\u6B21\u8BF7\u8054\u7CFB\u5BA2\u670D\u627E\u56DE
140115=\u5BC6\u7801\u9519\u8BEF\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D\u91CD\u7F6E\u5BC6\u7801 140115=\u5BC6\u7801\u9519\u8BEF\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u8BF7\u8054\u7CFB\u5BA2\u670D\u91CD\u7F6E\u5BC6\u7801
140116=\u5BC6\u7801\u9519\u8BEF\uFF0C\u518D\u8F93\u9519%d\u6B21\u5C06\u9501\u5B9A%d\u5206\u949F 140116=\u5BC6\u7801\u9519\u8BEF\uFF0C\u518D\u8F93\u9519%d\u6B21\u5C06\u9501\u5B9A%d\u5206\u949F
140117=\u8BE5\u85CF\u54C1\u5DF2\u8FC7\u9886\u53D6\u6709\u6548\u671F 140117=%d\u5206\u949F\u9501\u5B9A\u65F6\u95F4\u672A\u7ED3\u675F\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5
140118=\u8BE5\u85CF\u54C1\u5DF2\u9886\u53D6 140118=\u8BE5\u85CF\u54C1\u5DF2\u8FC7\u9886\u53D6\u6709\u6548\u671F
140119=\u8BE5\u85CF\u54C1\u5DF2\u9000\u8FD8 140119=\u60A8\u5DF2\u9886\u53D6\u8BE5\u85CF\u54C1
140120=\u8BE5\u85CF\u54C1\u5DF2\u9000\u8FD8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment