mirror of https://gitee.com/stylefeng/roses
【SysUser】修改登录错误账号提示
parent
0a6ab12db6
commit
a6cba98d7e
|
@ -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", "{} 用户不存在"),
|
||||
|
||||
/**
|
||||
* 账号已存在
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue