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

Commit 066571db authored by zhanggb's avatar zhanggb

~手机号静默登录接口(内部调用);

parent 3fa927f7
......@@ -336,14 +336,15 @@ public class AdamLoginController {
@NotBlank(message = "临时票据不能为空")
@RequestParam String otp) {
log.info("login by silent for mobile:{},{}", mobile, otp);
long reql = 0, l = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC);
String otpDecrypt = null;
try {
otpDecrypt = DESUtils.DES().decrypt(otp);
reql = Long.parseLong(otpDecrypt.substring(11));
} catch (Exception e) {
}
if (null == otpDecrypt || !otpDecrypt.substring(5).equals(mobile)) {
log.error("login by silent for mobile:{},{}/{}", mobile, otp, otpDecrypt);
if (l - reql > 3 || (null != otpDecrypt && !otpDecrypt.substring(0, 10).equals(mobile))) {
log.error("login by silent for mobile:{},{}/{},{}-{}", mobile, otp, otpDecrypt, l, reql);
return ResponseDto.failure(ErrorMapping.get("10005"));
}
......
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