@RequestMapping(value = "/signin/validate", method = RequestMethod.POST)
public @ResponseBody
Object[] validateSignIn(@Valid SignInCredentialVo signInCredentialVo,
BindingResult result, Model model, HttpSession session) {
User existed = null;
if (!result.hasFieldErrors("signInName")) {
existed = userPepository.getByEmail(signInCredentialVo
.getSignInName());
if (existed == null) {
result.addError(new FieldError("signInCredentialVo",
"signInName", "注册邮箱不存在"));
} else {
if (!signInCredentialVo.getSignInPassword().equals(
existed.getPassword())) {
result.addError(new FieldError("signInCredentialVo",
"signInPassword", "密码不正确"));
}
if(existed.getStatus() == UserStatus.INVALID){
result.addError(new FieldError("signInCredentialVo",
"signInName", "账号暂时不能登陆"));
}
}
}