|
@ -493,5 +493,36 @@ public class LoginController extends BaseController {
|
|
// return error(-1, "短信发送失败!");
|
|
// return error(-1, "短信发送失败!");
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 患者,医生注册-验证手机号
|
|
|
|
*
|
|
|
|
* @param mobile 登录手机号
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "checkmobile")
|
|
|
|
@ResponseBody
|
|
|
|
public String checkmobile(@RequestParam(required = true,value = "mobile",defaultValue = "0")String mobile,
|
|
|
|
@RequestParam(required = true,value = "type",defaultValue = "0") int type) {
|
|
|
|
try {
|
|
|
|
if(type==0){//患者端
|
|
|
|
List<Patient> temp = patientService.findByMobile(mobile);
|
|
|
|
if (temp != null&&temp.size()>0) {
|
|
|
|
// 设置身份证号
|
|
|
|
return write(200, "手机号码已经被注册!");
|
|
|
|
}
|
|
|
|
return error(-1, "该手机号未被注册!");
|
|
|
|
}else if(type==1){
|
|
|
|
Doctor doctor = doctorService.findDoctorByMobile(mobile);
|
|
|
|
if(doctor!=null){
|
|
|
|
return write(200, "手机号码已经被注册!");
|
|
|
|
}
|
|
|
|
return error(-1, "该手机号未被注册!");
|
|
|
|
}else{
|
|
|
|
return error(1, "错误的请求类型!");
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
error(e);
|
|
|
|
return error(-1, "手机号验证失败");
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|