【SysUser】修改登录错误账号提示

pull/3/head
chenjinlong 2021-01-20 19:22:43 +08:00
parent 0a6ab12db6
commit a6cba98d7e
2 changed files with 5 additions and 3 deletions

View File

@ -41,7 +41,7 @@ public enum SysUserExceptionEnum implements AbstractExceptionEnum {
/**
*
*/
USER_NOT_EXIST(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "51", "用户不存在用户id或账号为{}"),
USER_NOT_EXIST(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "51", "{} 用户不存在"),
/**
*

View File

@ -398,12 +398,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 用户不存在
if (list.isEmpty()) {
throw new SystemModularException(SysUserExceptionEnum.USER_NOT_EXIST, account);
String userTip = StrUtil.format(SysUserExceptionEnum.USER_NOT_EXIST.getUserTip(), account);
throw new SystemModularException(SysUserExceptionEnum.USER_NOT_EXIST, userTip);
}
// 账号存在多个
if (list.size() > 1) {
throw new SystemModularException(SysUserExceptionEnum.ACCOUNT_HAVE_MANY, account);
String userTip = StrUtil.format(SysUserExceptionEnum.ACCOUNT_HAVE_MANY.getUserTip(), account);
throw new SystemModularException(SysUserExceptionEnum.ACCOUNT_HAVE_MANY, userTip);
}
return list.get(0);