|
@@ -13,6 +13,7 @@ import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
import com.zhongzheng.common.utils.AES;
|
|
|
import com.zhongzheng.framework.manager.factory.AsyncFactory;
|
|
|
import com.zhongzheng.modules.user.bo.UserBusinessLoginBo;
|
|
|
+import com.zhongzheng.modules.user.service.IUserLoginErrorService;
|
|
|
import org.apache.commons.compress.utils.IOUtils;
|
|
|
import org.bouncycastle.jcajce.provider.asymmetric.rsa.RSAUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -57,6 +58,8 @@ public class SysLoginService
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserLoginErrorService iUserLoginErrorService;
|
|
|
/**
|
|
|
* 登录验证
|
|
|
*
|
|
@@ -81,6 +84,7 @@ public class SysLoginService
|
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
|
throw new CaptchaException();
|
|
|
}
|
|
|
+ iUserLoginErrorService.checkLimit(username);
|
|
|
// 用户验证
|
|
|
Authentication authentication = null;
|
|
|
try
|
|
@@ -103,6 +107,7 @@ public class SysLoginService
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
+ iUserLoginErrorService.saveErrorLog(username);
|
|
|
if (e instanceof BadCredentialsException)
|
|
|
{
|
|
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|