|
@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springside.modules.security.utils.Digests;
|
|
|
import org.springside.modules.utils.Encodes;
|
|
|
|
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
@ -1886,5 +1887,59 @@ public class DoctorController extends BaseController {
|
|
|
return invalidUserException(e, -1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 设置审方密码
|
|
|
* @param password
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/setCheckPassword", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@ObserverRequired
|
|
|
public String setCheckPassword(@RequestParam String password){
|
|
|
|
|
|
try {
|
|
|
|
|
|
Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
|
|
|
if (doctor == null) {
|
|
|
return error(-1, "密码设置失败!");
|
|
|
}
|
|
|
doctorInfoService.setCheckPassword(doctor,password);
|
|
|
return write(200, "密码设置成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "密码设置失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改审方密码
|
|
|
* @param oldPassword
|
|
|
* @param newPassword
|
|
|
* @return
|
|
|
*/
|
|
|
@ObserverRequired
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/updateCheckPassword", method = RequestMethod.POST)
|
|
|
public String updateCheckPassword(@RequestParam String oldPassword,@RequestParam String newPassword){
|
|
|
|
|
|
try {
|
|
|
Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
|
|
|
if (doctor == null) {
|
|
|
return error(-1, "修改审方密码失败!");
|
|
|
} else {
|
|
|
String encodePWD = EncodesUtil.entryptPassword(Encodes.decodeHex(doctor.getCheckSalt()), oldPassword);
|
|
|
if (StringUtils.equals(doctor.getCheckPassword(), encodePWD)) {
|
|
|
doctorInfoService.setCheckPassword(doctor,newPassword);
|
|
|
return write(200, "密码设置成功");
|
|
|
} else {
|
|
|
return error(-1, "修改失败:审方旧密码错误!");
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "修改失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|