From e4a508f6834bfacd215a4aac21433f59e80e8b70 Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Thu, 19 May 2022 11:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=82=A3=E8=80=85=E6=B3=A8=E5=86=8C=E7=8A=B6=E6=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/talkonlineweb/controller/PatientController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 1.8.3.1