|
|
|
@ -88,8 +88,16 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
|
|
|
|
|
// //从缓存中删除验证码
|
|
|
|
|
// iCacheManager.remove(CacheConstants.CACHE_CODE,codetoken);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(loginname) || StringUtils.isBlank(password)){
|
|
|
|
|
throw new AuthenticationServiceException("账号密码不正确");
|
|
|
|
|
// if(StringUtils.isBlank(loginname) || StringUtils.isBlank(password)){
|
|
|
|
|
// throw new AuthenticationServiceException("账号密码不正确");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(loginname)){
|
|
|
|
|
throw new AuthenticationServiceException("请输入账号!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(password)){
|
|
|
|
|
throw new AuthenticationServiceException("密码错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断验证码不能为空
|
|
|
|
@ -102,12 +110,19 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
|
|
|
|
|
// throw new AuthenticationServiceException("验证码错误");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//判断手机号与企业编码是否存在
|
|
|
|
|
// if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
|
|
|
|
|
// throw new AuthenticationServiceException("企业编码或账号错误");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//判断手机号与企业编码是否存在
|
|
|
|
|
if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
|
|
|
|
|
throw new AuthenticationServiceException("企业编码或账号错误");
|
|
|
|
|
throw new AuthenticationServiceException("企业编码错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
|
|
|
|
|
throw new AuthenticationServiceException("账号不存在!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//数据库查询用户对象
|
|
|
|
|
User user = userTokenService.findByLoginname(loginname);
|
|
|
|
|
if(null == user){
|
|
|
|
|