|
@ -1837,8 +1837,12 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
iliness.add(family.getString("ILLNESS"));
|
|
|
}
|
|
|
}
|
|
|
String birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO1.getIdcard());
|
|
|
Integer age = com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO1.getIdcard());
|
|
|
String birdth = null;
|
|
|
Integer age = 0;
|
|
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(basePatientDO1.getIdcard())){
|
|
|
birdth = com.yihu.jw.util.idcard.IdCardUtil.getBirthdayForIdcardStr(basePatientDO1.getIdcard());
|
|
|
age =com.yihu.jw.util.idcard.IdCardUtil.getAgeForIdcard(basePatientDO1.getIdcard());
|
|
|
}
|
|
|
Integer sex = basePatientDO1.getSex()!=null?basePatientDO1.getSex():0;
|
|
|
if (iliness!=null&&iliness.size()!=0){
|
|
|
if (!iliness.contains("本人")){
|
|
@ -1865,17 +1869,20 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
} else {
|
|
|
parameters.put("grant_type", "captcha");
|
|
|
}
|
|
|
|
|
|
logger.info("登陆111111111111111111");
|
|
|
ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
|
|
|
if (null == authenticatedClient) {
|
|
|
throw new InvalidRequestException("client_id");
|
|
|
}
|
|
|
|
|
|
logger.info("登陆22222222222222222");
|
|
|
TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
|
|
|
oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
|
|
|
OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
|
|
|
if (token == null) {
|
|
|
throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
|
|
|
}
|
|
|
logger.info("登陆33333333333333333333");
|
|
|
/*如果是移动端登陆则移除之前的token,
|
|
|
在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
|
|
|
实现同一账号只能在一处登陆*/
|
|
@ -1888,6 +1895,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
|
|
|
if (token == null) {
|
|
|
throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
|
|
|
}
|
|
|
logger.info("登陆4444444444444444");
|
|
|
WlyyUserSimple wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
|
|
|
wlyyUserSimple.setAccessToken(token.getValue());
|
|
|
wlyyUserSimple.setTokenType(token.getTokenType());
|