修改用户bug
This commit is contained in:
parent
b2c47fcf2c
commit
791a90be64
|
|
@ -72,34 +72,32 @@ public class SysLoginService
|
||||||
}
|
}
|
||||||
LoginUser userInfo = userResult.getData();
|
LoginUser userInfo = userResult.getData();
|
||||||
SysUser user = userResult.getData().getSysUser();
|
SysUser user = userResult.getData().getSysUser();
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
if (UserStatus.DELETED.getCode().equals(user.getStatus())) {
|
||||||
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已被删除",1,0,"username="+username,startTime);
|
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已被停用",1,0,"{'username':'"+username+"'",startTime);
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已被删除",201);
|
throw new ServiceException("对不起,您的账号:" + username + " 已被停用",201);
|
||||||
}
|
}
|
||||||
if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||||
{
|
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已锁定",1,0,"{'username':'"+username+"'",startTime);
|
||||||
recordLogService.recordLogininfor(username,null,"用户登录","对不起,您的账号:" + username + " 已锁定",1,0,"username="+username,startTime);
|
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已锁定",201);
|
throw new ServiceException("对不起,您的账号:" + username + " 已锁定",201);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringHelper.isEmpty(loginType)){
|
if(StringHelper.isEmpty(loginType)){
|
||||||
if(!user.getLoginType().contains(Constant.BACK_LOGIN)){
|
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);
|
throw new ServiceException("对不起,您的账号:" + username + " 无登录后台权限",201);
|
||||||
}
|
}
|
||||||
}else if(Constant.SC_SCREEN.equals(loginType)){
|
}else if(Constant.SC_SCREEN.equals(loginType)){
|
||||||
if(!user.getLoginType().contains(Constant.SC_SCREEN)){
|
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);
|
throw new ServiceException("对不起,您的账号:" + username + " 无登录省侧大屏权限",201);
|
||||||
}
|
}
|
||||||
}else if(Constant.SG_SCREEN.equals(loginType)){
|
}else if(Constant.SG_SCREEN.equals(loginType)){
|
||||||
if(!user.getLoginType().contains(Constant.SG_SCREEN)){
|
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);
|
throw new ServiceException("对不起,您的账号:" + username + " 无登录施工大屏权限",201);
|
||||||
}
|
}
|
||||||
}else if(Constant.APP_LOGIN.equals(loginType)){
|
}else if(Constant.APP_LOGIN.equals(loginType)){
|
||||||
if(!user.getLoginType().contains(Constant.APP_LOGIN)){
|
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);
|
throw new ServiceException("对不起,您的账号:" + username + " 无登录APP权限",201);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -112,9 +110,9 @@ public class SysLoginService
|
||||||
if(ip.equals(hisIp)){
|
if(ip.equals(hisIp)){
|
||||||
redisUtil.set("username",ip,times);
|
redisUtil.set("username",ip,times);
|
||||||
}else{
|
}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);
|
remoteUserService.updateUserLogin(user.getUserId(),SecurityConstants.INNER);
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ public class UserVo {
|
||||||
@ApiModelProperty(value = "账号状态")
|
@ApiModelProperty(value = "账号状态")
|
||||||
private Integer accountStatus;
|
private Integer accountStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账号状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private int delFlag;
|
private int delFlag;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequestWrapper;
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||||
|
|
||||||
private byte[] body;
|
private byte[] body;
|
||||||
|
|
||||||
private String queryString;
|
private String queryString;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import org.springframework.context.annotation.Configuration;
|
||||||
* 自定义密码加密
|
* 自定义密码加密
|
||||||
* @author 黑子
|
* @author 黑子
|
||||||
*/
|
*/
|
||||||
//@Configuration
|
|
||||||
public class CodeSheepEncryptorCfg {
|
public class CodeSheepEncryptorCfg {
|
||||||
|
|
||||||
@Bean(name = "codeSheepEncryptorBean" )
|
@Bean(name = "codeSheepEncryptorBean" )
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,13 @@
|
||||||
su.login_name AS loginName,
|
su.login_name AS loginName,
|
||||||
su.del_flag AS delFlag,
|
su.del_flag AS delFlag,
|
||||||
su.phone,
|
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
|
su.del_flag AS delFlag
|
||||||
FROM sys_user su
|
FROM sys_user su
|
||||||
<where>
|
<where>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue