|
@ -282,7 +282,7 @@ public class LoginController extends BaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String forgetpwd(int type,
|
|
public String forgetpwd(int type,
|
|
@RequestParam(required = false) String idcard,
|
|
@RequestParam(required = false) String idcard,
|
|
String mobile,
|
|
|
|
|
|
@RequestParam(required = false) String mobile,
|
|
@RequestParam(required = false) String captchaToken,
|
|
@RequestParam(required = false) String captchaToken,
|
|
@RequestParam(required = false)String captcha,
|
|
@RequestParam(required = false)String captcha,
|
|
@RequestParam(required = false)String patient,
|
|
@RequestParam(required = false)String patient,
|
|
@ -302,40 +302,28 @@ public class LoginController extends BaseController {
|
|
// newpwd = URLDecoder.decode(newpwd, "UTF-8");
|
|
// newpwd = URLDecoder.decode(newpwd, "UTF-8");
|
|
// newpwd = StringUtils.reverse(newpwd);
|
|
// newpwd = StringUtils.reverse(newpwd);
|
|
// 对验证码进行校验
|
|
// 对验证码进行校验
|
|
// int res = smsService.check(mobile, type, captcha);
|
|
|
|
// switch (res) {
|
|
|
|
// case -2:
|
|
|
|
// return error(-1, "验证码已过期!");
|
|
|
|
// case -1:
|
|
|
|
// return error(-1, "验证码错误!");
|
|
|
|
// case 0:
|
|
|
|
// return error(-1, "验证码无效!");
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
if (type == 2) {
|
|
if (type == 2) {
|
|
// 医生端
|
|
// 医生端
|
|
Doctor doctor = doctorService.findDoctorByMobile(mobile);
|
|
|
|
if (doctor == null) {
|
|
|
|
return error(-1, "操作失败:此用户未注册");
|
|
|
|
} else {
|
|
|
|
|
|
Doctor doctor = doctorService.findDoctorByMobile(mobile);
|
|
String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
|
|
String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
|
|
password=StringUtils.reverse(password);
|
|
password=StringUtils.reverse(password);
|
|
password=MD5.GetMD5Code(password+doctor.getSalt());
|
|
password=MD5.GetMD5Code(password+doctor.getSalt());
|
|
doctor.setPassword(password);
|
|
doctor.setPassword(password);
|
|
doctorService.updateDoctorPwd(doctor);
|
|
doctorService.updateDoctorPwd(doctor);
|
|
return success("操作成功!");
|
|
return success("操作成功!");
|
|
}
|
|
|
|
} else {
|
|
} else {
|
|
// 患者端
|
|
// 患者端
|
|
List<Patient> patients = patientService.findByMobile(mobile);
|
|
|
|
if (patients == null||patients.size()==0||StringUtils.isBlank(patient)) {
|
|
|
|
|
|
Patient patientTemp = patientService.findByIdcard(idcard);
|
|
|
|
if (patientTemp == null) {
|
|
return error(-1, "操作失败:此用户未注册");
|
|
return error(-1, "操作失败:此用户未注册");
|
|
} else {
|
|
} else {
|
|
Patient p = patientService.findByCode(patient);
|
|
|
|
String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
|
|
String password = RSAUtils.getInstance(doctorService).decryptString(newpwd);
|
|
password=StringUtils.reverse(password);
|
|
password=StringUtils.reverse(password);
|
|
password=MD5.GetMD5Code(password+p.getSalt());
|
|
|
|
p.setPassword(password);
|
|
|
|
patientService.updatePatientPwd(p);
|
|
|
|
|
|
password=MD5.GetMD5Code(password+patientTemp.getSalt());
|
|
|
|
patientTemp.setPassword(password);
|
|
|
|
patientService.updatePatientPwd(patientTemp);
|
|
return success("操作成功!");
|
|
return success("操作成功!");
|
|
}
|
|
}
|
|
}
|
|
}
|