Commit 952fc2b2 authored by 董建华's avatar 董建华

登录限制

parent 84c4f54a
......@@ -527,6 +527,8 @@ public class UserController implements IBaseController {
return JsonResult.buildErrorStateResult("登录时微信关联失败", null);
}
LoginProperties loginProperties = new LoginProperties("", 4, channelId, createdFrom, appChannel, merchant.getId(), merchant.getName());
//尝试解锁
lockIpv4Service.unLockPhone(user.getPhoneNo());
//更新session
return new JsonResult(sessionService.createSession(user, loginProperties));
}
......
......@@ -136,7 +136,7 @@ public class LockIpv4ServiceImpl implements ILockIpv4Service {
@Override
public void lockPhone(String phone, long count) {
if (count >= Constants.PASSWORD_ERROR_LOCK_COUNT) {
if (count == Constants.PASSWORD_ERROR_LOCK_COUNT) {
String lock_key = Constants.PASSWORD_LOCK_PRE.concat(phone);
//Constants.PASSWORD_LOCK_PRE
......@@ -145,6 +145,11 @@ public class LockIpv4ServiceImpl implements ILockIpv4Service {
if (!isLock) {
stringRedisTemplate.opsForValue().set(lock_key, "lock", Constants.PASSWORD_ERROR_LOCK_TIME, TimeUnit.MINUTES);
}
}else if(count > Constants.PASSWORD_ERROR_LOCK_COUNT){
/**
* 如果超过阈值再进来则说明过了限制时间,解锁清楚次数
*/
unLockPhone(phone);
}
}
......
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