|
|
|
@ -34,6 +34,7 @@ import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
import org.apache.commons.lang.text.StrBuilder;
|
|
|
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
@ -100,6 +101,9 @@ public class SysUserController extends CoreBaseController {
|
|
|
|
|
@Resource(name = CommonConstWords.IMPP_REDIS_RES)
|
|
|
|
|
private ImppRedis redisRes;
|
|
|
|
|
|
|
|
|
|
@Resource(name = CommonConstWords.IMPP_REDIS_CORE)
|
|
|
|
|
protected ImppRedis redisCore;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增系统用户
|
|
|
|
|
*
|
|
|
|
@ -277,7 +281,10 @@ public class SysUserController extends CoreBaseController {
|
|
|
|
|
ValidatorBean.checkNotZero(status, "功能状态不能为空");
|
|
|
|
|
|
|
|
|
|
sysUserService.updateBatchSysUserStatus(StringTool.getArrayLong(ids), status, AuthUtil.getSessionUser());
|
|
|
|
|
|
|
|
|
|
//当解除锁定状态 重置当天登录错误次数上限
|
|
|
|
|
if (CommonEnumUtil.USER_STATUS.ENABLE.getValue() == status) {
|
|
|
|
|
deleteRedisLoginErrorKeys(ids);
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
@ -287,6 +294,22 @@ public class SysUserController extends CoreBaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除登录错误的次数
|
|
|
|
|
*
|
|
|
|
|
* @param ids
|
|
|
|
|
*/
|
|
|
|
|
private void deleteRedisLoginErrorKeys(String[] ids) {
|
|
|
|
|
String[] keys = new String[ids.length];
|
|
|
|
|
StringBuilder redisKey = new StringBuilder();
|
|
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
|
|
redisKey.append(CommonConstWords.USER_LOGIN_ERROR).append(":").append(TimeTool.getToday()).append(":").append(ids[i]);
|
|
|
|
|
keys[i] = redisKey.toString();
|
|
|
|
|
redisKey.setLength(0);
|
|
|
|
|
}
|
|
|
|
|
redisCore.deleteKey(keys);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据登录的用户名批量修改账号状态
|
|
|
|
|
*
|
|
|
|
|
* @param userLoginNames 用户名数组
|
|
|
|
|