|
@@ -6,7 +6,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
-import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.util.PasswordUtil;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
@@ -37,7 +36,7 @@ public class ApiUserController extends ApiBaseController {
|
|
|
@IgnoreAuth
|
|
|
public Result<?> userRegister(@RequestBody UserDTO dto) {
|
|
|
if (StringUtils.isBlank(dto.getUsername())) {
|
|
|
- throw new JeecgBootException("账号不能为空");
|
|
|
+ return Result.error("账号不能为空");
|
|
|
}
|
|
|
SysUser user1 = sysUserService.getUserByName(dto.getUsername());
|
|
|
if (!Objects.isNull(user1)) {
|
|
@@ -46,7 +45,13 @@ public class ApiUserController extends ApiBaseController {
|
|
|
if (StringUtils.isNotBlank(dto.getPhone())) {
|
|
|
SysUser user2 = sysUserService.getUserByPhone(dto.getPhone());
|
|
|
if (!Objects.isNull(user2)) {
|
|
|
- return Result.error("该手机号已被注册");
|
|
|
+ return Result.error("手机号已被注册");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(dto.getEmail())) {
|
|
|
+ SysUser user3 = sysUserService.getUserByEmail(dto.getEmail());
|
|
|
+ if (!Objects.isNull(user3)) {
|
|
|
+ return Result.error("邮箱已被注册");
|
|
|
}
|
|
|
}
|
|
|
SysUser user = new SysUser();
|