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