修改用户bug

This commit is contained in:
haozq 2024-04-23 18:02:12 +08:00
parent b2c47fcf2c
commit 791a90be64
5 changed files with 22 additions and 14 deletions

View File

@ -72,34 +72,32 @@ public class SysLoginService
}
LoginUser userInfo = userResult.getData();
SysUser user = userResult.getData().getSysUser();
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已被删除",1,0,"username="+username,startTime);
throw new ServiceException("对不起,您的账号:" + username + " 已被删除",201);
if (UserStatus.DELETED.getCode().equals(user.getStatus())) {
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已被停用",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 已被停用",201);
}
if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
{
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已锁定",1,0,"username="+username,startTime);
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已锁定",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 已锁定",201);
}
if(StringHelper.isEmpty(loginType)){
if(!user.getLoginType().contains(Constant.BACK_LOGIN)){
recordLogService.recordLogininfor(username,null,"用户登录","无登录后台权限",1,0,"username="+username,startTime);
recordLogService.recordLogininfor(username,null,"用户登录","无登录后台权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录后台权限",201);
}
}else if(Constant.SC_SCREEN.equals(loginType)){
if(!user.getLoginType().contains(Constant.SC_SCREEN)){
recordLogService.recordLogininfor(username,null,"省侧大屏用户登录","无登录省侧大屏权限",1,0,"username="+username,startTime);
recordLogService.recordLogininfor(username,null,"省侧大屏用户登录","无登录省侧大屏权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录省侧大屏权限",201);
}
}else if(Constant.SG_SCREEN.equals(loginType)){
if(!user.getLoginType().contains(Constant.SG_SCREEN)){
recordLogService.recordLogininfor(username,null,"施工大屏用户登录","无登录施工大屏权限",1,0,"username="+username,startTime);
recordLogService.recordLogininfor(username,null,"施工大屏用户登录","无登录施工大屏权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录施工大屏权限",201);
}
}else if(Constant.APP_LOGIN.equals(loginType)){
if(!user.getLoginType().contains(Constant.APP_LOGIN)){
recordLogService.recordLogininfor(username,null,"APP用户登录","无登录APP权限",1,0,"username="+username,startTime);
recordLogService.recordLogininfor(username,null,"APP用户登录","无登录APP权限",1,0,"{'username':'"+username+"'",startTime);
throw new ServiceException("对不起,您的账号:" + username + " 无登录APP权限",201);
}
}
@ -112,9 +110,9 @@ public class SysLoginService
if(ip.equals(hisIp)){
redisUtil.set("username",ip,times);
}else{
recordLogService.errorLogs(username,user.getUserId(),"用户登录","IP异常",1,1,"username="+username,startTime);
recordLogService.errorLogs(username,user.getUserId(),"用户登录","IP异常",1,1,"{'username':'"+username+"'",startTime);
}
recordLogService.recordLogininfor(username,user.getUserId(), "用户登录", "登录成功",1,1,"username="+username,startTime);
recordLogService.recordLogininfor(username,user.getUserId(), "用户登录", "登录成功",1,1,"{'username':'"+username+"'",startTime);
remoteUserService.updateUserLogin(user.getUserId(),SecurityConstants.INNER);
return userInfo;
}

View File

@ -59,6 +59,9 @@ public class UserVo {
@ApiModelProperty(value = "账号状态")
private Integer accountStatus;
@ApiModelProperty(value = "账号状态")
private String status;
@ApiModelProperty(value = "状态")
private int delFlag;

View File

@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequestWrapper;
*/
@Slf4j
public class XssRequestWrapper extends HttpServletRequestWrapper {
private byte[] body;
private String queryString;

View File

@ -10,7 +10,6 @@ import org.springframework.context.annotation.Configuration;
* 自定义密码加密
* @author 黑子
*/
//@Configuration
public class CodeSheepEncryptorCfg {
@Bean(name = "codeSheepEncryptorBean" )

View File

@ -71,6 +71,13 @@
su.login_name AS loginName,
su.del_flag AS delFlag,
su.phone,
CASE
WHEN su.del_flag=1 then '已注销'
WHEN su.status=0 then '正常'
WHEN su.status=1 then '锁定'
WHEN su.status=2 then '停用'
else '正常'
end status ,
su.del_flag AS delFlag
FROM sys_user su
<where>