|
|
@ -85,20 +85,20 @@ public class ManagerController { |
|
|
|
return new JSONResponse<>(Result.FAIL,"密码不能为空",null); |
|
|
|
return new JSONResponse<>(Result.FAIL,"密码不能为空",null); |
|
|
|
}else if(StringUtils.isEmpty(manager.getConfirmPassword())){ |
|
|
|
}else if(StringUtils.isEmpty(manager.getConfirmPassword())){ |
|
|
|
return new JSONResponse<>(Result.FAIL,"确认密码不能为空",null); |
|
|
|
return new JSONResponse<>(Result.FAIL,"确认密码不能为空",null); |
|
|
|
}else if(!manager.getPassword().equals(manager.getConfirmPassword())){ |
|
|
|
}else if (!manager.getPassword().equals(manager.getConfirmPassword())) { |
|
|
|
return new JSONResponse<>(Result.FAIL,"两次密码输入不一致",null); |
|
|
|
return new JSONResponse<>(Result.FAIL, "两次密码输入不一致", null); |
|
|
|
}else if(StringUtils.isEmpty(manager.getMobie())){ |
|
|
|
} else if (StringUtils.isEmpty(manager.getMobile())) { |
|
|
|
return new JSONResponse<>(Result.FAIL,"手机号不能为空",null); |
|
|
|
return new JSONResponse<>(Result.FAIL, "手机号不能为空", null); |
|
|
|
}else if(StringUtils.isEmpty(manager.getEmail())){ |
|
|
|
} else if (StringUtils.isEmpty(manager.getEmail())) { |
|
|
|
return new JSONResponse<>(Result.FAIL,"邮箱不能为空",null); |
|
|
|
return new JSONResponse<>(Result.FAIL, "邮箱不能为空", null); |
|
|
|
}else if(managerDao.hasUser(manager.getManagerName())){ |
|
|
|
} else if (managerDao.hasUser(manager.getManagerName())) { |
|
|
|
return new JSONResponse<>(Result.FAIL,"用户已存在",null); |
|
|
|
return new JSONResponse<>(Result.FAIL, "用户已存在", null); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
// 表单数据转换到管理员实体,调用dao层持久化到数据库
|
|
|
|
// 表单数据转换到管理员实体,调用dao层持久化到数据库
|
|
|
|
Manager m=new Manager(); |
|
|
|
Manager m = new Manager(); |
|
|
|
m.setManagerName(manager.getManagerName()); |
|
|
|
m.setManagerName(manager.getManagerName()); |
|
|
|
m.setPassword(DigestUtils.md5DigestAsHex(manager.getPassword().getBytes())); |
|
|
|
m.setPassword(DigestUtils.md5DigestAsHex(manager.getPassword().getBytes())); |
|
|
|
m.setMobie(manager.getMobie()); |
|
|
|
m.setMobile(manager.getMobile()); |
|
|
|
m.setEmail(manager.getEmail()); |
|
|
|
m.setEmail(manager.getEmail()); |
|
|
|
managerDao.save(m); |
|
|
|
managerDao.save(m); |
|
|
|
return new JSONResponse<>(Result.OK,"注册成功",null); |
|
|
|
return new JSONResponse<>(Result.OK,"注册成功",null); |
|
|
|