|
@@ -93,20 +93,20 @@ public class SysLoginService
|
|
*/
|
|
*/
|
|
public String login(String username, String password, String code, String uuid,String smsCode,String tel)
|
|
public String login(String username, String password, String code, String uuid,String smsCode,String tel)
|
|
{
|
|
{
|
|
- String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
|
|
|
- String captcha = redisCache.getCacheObject(verifyKey);
|
|
|
|
- redisCache.deleteObject(verifyKey);
|
|
|
|
- if (captcha == null)
|
|
|
|
- {
|
|
|
|
- AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
|
|
- throw new CaptchaExpireException();
|
|
|
|
- }
|
|
|
|
- if (!code.equalsIgnoreCase(captcha))
|
|
|
|
- {
|
|
|
|
- AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
|
|
- throw new CaptchaException();
|
|
|
|
- }
|
|
|
|
- iUserLoginErrorService.checkLimit(username);
|
|
|
|
|
|
+// String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
|
|
|
|
+// String captcha = redisCache.getCacheObject(verifyKey);
|
|
|
|
+// redisCache.deleteObject(verifyKey);
|
|
|
|
+// if (captcha == null)
|
|
|
|
+// {
|
|
|
|
+// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
|
|
|
|
+// throw new CaptchaExpireException();
|
|
|
|
+// }
|
|
|
|
+// if (!code.equalsIgnoreCase(captcha))
|
|
|
|
+// {
|
|
|
|
+// AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
|
|
|
|
+// throw new CaptchaException();
|
|
|
|
+// }
|
|
|
|
+// iUserLoginErrorService.checkLimit(username);
|
|
// 用户验证
|
|
// 用户验证
|
|
Authentication authentication = null;
|
|
Authentication authentication = null;
|
|
try
|
|
try
|
|
@@ -152,7 +152,7 @@ public class SysLoginService
|
|
loginUser.setPhoneConcealSign(1);
|
|
loginUser.setPhoneConcealSign(1);
|
|
}else {
|
|
}else {
|
|
List<SysUserRole> list = iSysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>()
|
|
List<SysUserRole> list = iSysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>()
|
|
- .eq(SysUserRole::getUserId, user.getUserId()).eq(SysUserRole::getTenantId,user.getTenantId()));
|
|
|
|
|
|
+ .eq(SysUserRole::getUserId, user.getUserId()));
|
|
if (CollectionUtils.isNotEmpty(list)){
|
|
if (CollectionUtils.isNotEmpty(list)){
|
|
List<SysRole> sysRoles = iSysRoleService.listByIds(list.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()));
|
|
List<SysRole> sysRoles = iSysRoleService.listByIds(list.stream().map(SysUserRole::getRoleId).collect(Collectors.toList()));
|
|
if (sysRoles.stream().anyMatch(x -> x.getPhoneConceal() == 1)){
|
|
if (sysRoles.stream().anyMatch(x -> x.getPhoneConceal() == 1)){
|