|
@@ -65,9 +65,10 @@ public class UserRegisterController extends BaseController {
|
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- User u = userService.selectByNameAndType(user.getUsername().trim(), null);
|
|
|
|
|
|
|
+ User u = userService.selectByMobieAndType(user.getMobile().trim(), user.getType());
|
|
|
if (null != u) {
|
|
if (null != u) {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
|
|
|
+ return res;
|
|
|
}
|
|
}
|
|
|
// 验证码15分钟有效
|
|
// 验证码15分钟有效
|
|
|
if (TimeUtils.checkOverTime("register")) {
|
|
if (TimeUtils.checkOverTime("register")) {
|
|
@@ -81,7 +82,6 @@ public class UserRegisterController extends BaseController {
|
|
|
if (res.getError().isEmpty()) {
|
|
if (res.getError().isEmpty()) {
|
|
|
User us = new User();
|
|
User us = new User();
|
|
|
us.setId(UUID.randomUUID().toString());
|
|
us.setId(UUID.randomUUID().toString());
|
|
|
- us.setUsername(user.getUsername().trim());
|
|
|
|
|
us.setMobile(user.getMobile().trim());
|
|
us.setMobile(user.getMobile().trim());
|
|
|
us.setPassword(user.getPassword());
|
|
us.setPassword(user.getPassword());
|
|
|
Calendar now = Calendar.getInstance();
|
|
Calendar now = Calendar.getInstance();
|
|
@@ -89,8 +89,8 @@ public class UserRegisterController extends BaseController {
|
|
|
us.setCreateTime(now.getTime());
|
|
us.setCreateTime(now.getTime());
|
|
|
us.setUpdateTime(now.getTime());
|
|
us.setUpdateTime(now.getTime());
|
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
|
- us.setLvl(0);
|
|
|
|
|
- us.setNickname(user.getUsername());
|
|
|
|
|
|
|
+ us.setNickname(user.getUnitName());
|
|
|
|
|
+ us.setType(user.getType());
|
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|
|
@@ -119,7 +119,7 @@ public class UserRegisterController extends BaseController {
|
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
- User u = userService.selectByNameAndType(user.getUsername().trim(), null);
|
|
|
|
|
|
|
+ User u = userService.selectByMobieAndType(user.getMobile().trim(), user.getType());
|
|
|
if (null != u) {
|
|
if (null != u) {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
|
}
|
|
}
|
|
@@ -135,7 +135,6 @@ public class UserRegisterController extends BaseController {
|
|
|
if (res.getError().isEmpty()) {
|
|
if (res.getError().isEmpty()) {
|
|
|
User us = new User();
|
|
User us = new User();
|
|
|
us.setId(UUID.randomUUID().toString());
|
|
us.setId(UUID.randomUUID().toString());
|
|
|
- us.setUsername(user.getUsername().trim());
|
|
|
|
|
us.setMobile(user.getMobile().trim());
|
|
us.setMobile(user.getMobile().trim());
|
|
|
us.setPassword(user.getPassword());
|
|
us.setPassword(user.getPassword());
|
|
|
Calendar now = Calendar.getInstance();
|
|
Calendar now = Calendar.getInstance();
|
|
@@ -143,8 +142,8 @@ public class UserRegisterController extends BaseController {
|
|
|
us.setCreateTime(now.getTime());
|
|
us.setCreateTime(now.getTime());
|
|
|
us.setUpdateTime(now.getTime());
|
|
us.setUpdateTime(now.getTime());
|
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
|
- us.setLvl(0);
|
|
|
|
|
- us.setNickname(user.getUsername());
|
|
|
|
|
|
|
+ us.setType(user.getType());
|
|
|
|
|
+ us.setNickname(user.getUnitName());
|
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|