|
@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
|
|
import com.google.code.kaptcha.util.Config;
|
|
|
import com.netflix.discovery.converters.Auto;
|
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
|
|
|
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.wx.WxWechatDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.restmodel.ResultStatus;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
@ -16,6 +18,7 @@ import com.yihu.jw.security.dao.OauthKeypairDao;
|
|
|
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
|
|
|
import com.yihu.jw.security.dao.patient.BasePatientDao;
|
|
|
import com.yihu.jw.security.dao.patient.WechatDao;
|
|
|
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.security.exception.ImgCaptchaException;
|
|
|
import com.yihu.jw.security.login.service.BaseLoginLogService;
|
|
|
import com.yihu.jw.security.model.*;
|
|
@ -149,6 +152,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
private XzzxService xzzxService;
|
|
|
@Autowired
|
|
|
private WechatDao wechatDao;
|
|
|
@Autowired
|
|
|
private WlyyHospitalSysDictDao wlyyhospitalSysdictDao;
|
|
|
|
|
|
@PostConstruct
|
|
|
private void init() {
|
|
@ -174,12 +179,20 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> login(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
|
|
|
|
|
|
logger.info("login:登录进入1");
|
|
|
//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
|
|
|
String isNeedPictureCode = "1";
|
|
|
if (wlyyHospitalSysDictDO!=null){
|
|
|
isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
|
|
|
}
|
|
|
logger.info("isNeedPictureCode:"+isNeedPictureCode);
|
|
|
if ("1".equalsIgnoreCase(isNeedPictureCode)){
|
|
|
//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
logger.info("login:登录进入2");
|
|
@ -1720,14 +1733,25 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykLogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
|
|
|
|
|
|
//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
/*String key = parameters.get("key");
|
|
|
String text = parameters.get("text");*/
|
|
|
String captcha = parameters.get("captcha");
|
|
|
String loginType = parameters.get("login_type");
|
|
|
String appletCode = parameters.get("appletCode");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
|
|
|
String isNeedPictureCode = "1";
|
|
|
if (wlyyHospitalSysDictDO!=null){
|
|
|
isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
|
|
|
}
|
|
|
logger.info("isNeedPictureCode:"+isNeedPictureCode);
|
|
|
if ("1".equalsIgnoreCase(isNeedPictureCode)){
|
|
|
//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
String username = parameters.get("username");
|
|
@ -2025,12 +2049,23 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
@RequestMapping(value = "/oauth/ykDoctorlogin", method = RequestMethod.POST)
|
|
|
public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykDoctorlogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
|
|
|
logger.info("login:登录进入1");
|
|
|
//图形验证码验证
|
|
|
/*//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
String text = parameters.get("text");*/
|
|
|
WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
|
|
|
String isNeedPictureCode = "1";
|
|
|
if (wlyyHospitalSysDictDO!=null){
|
|
|
isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
|
|
|
}
|
|
|
logger.info("isNeedPictureCode:"+isNeedPictureCode);
|
|
|
if ("1".equalsIgnoreCase(isNeedPictureCode)){
|
|
|
//图形验证码验证
|
|
|
String key = parameters.get("key");
|
|
|
String text = parameters.get("text");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
|
|
|
if(!verifyCaptcha(key,text)){
|
|
|
throw new ImgCaptchaException("img_captcha error");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
logger.info("login:登录进入2");
|