diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index eb64269..550fe0f 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -938,8 +938,6 @@ public class PatientController { // @TokenRequired public BaseResponse signInPatient(@RequestBody LymsPatient patient) { BaseResponse baseResponse = new BaseResponse(); - baseResponse.setErrorcode(1); - baseResponse.setErrormsg("身份证已注册。如有疑问请联系管理员!"); patient.setIdno(patient.getIdno().toLowerCase()); LymsPatient tmpP=new LymsPatient(); tmpP.setIdno(patient.getIdno().toLowerCase()); @@ -950,8 +948,11 @@ public class PatientController { patient.setPpasswd(DigestUtils.md5DigestAsHex(patient.getPpasswd().getBytes())); } boolean f = lymsPatientService.save(patient); - baseResponse.setErrorcode(0); - baseResponse.setErrormsg("注册成功!"); + baseResponse.setErrorcode(f?0:1); + baseResponse.setErrormsg(f?"注册成功!":"注册失败!"); + }else { + baseResponse.setErrorcode(2); + baseResponse.setErrormsg("身份证已注册!"); } return baseResponse; }