Merge pull request 'fix:修改账号密码登录模块,在输入错误的企业编码、账号、密码时,弹出对应的提示信息' (#10) from fix/loginErrorCheck_2783 into test

Reviewed-on: #10
pull/14/head
cuihaojie 1 year ago
commit ebc9a535f3

@ -131,6 +131,22 @@ public interface UserTokenService {
* @return
*/
public Long listCount(String otherno,String loginname);
/**
*
* @param otherno
* @return
*/
public Long listOthernoCount(String otherno);
/**
*
* @param otherno
* @param loginname
* @return
*/
public Long listLoginNameCount(String otherno,String loginname);
/**
*

@ -120,7 +120,12 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
// }
//判断手机号与企业编码是否存在
if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
// if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
// throw new AuthenticationServiceException("企业编码错误!");
// }
//企业编码是否存在
if(!"admin".equals(loginname) && userTokenService.listOthernoCount(agentcode).intValue() <= 0){
throw new AuthenticationServiceException("企业编码错误!");
}
@ -128,7 +133,9 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
if (!tenantStatus) {
throw new AuthenticationServiceException("该租户已被冻结!");
}
if(!"admin".equals(loginname) && userTokenService.listCount(agentcode,loginname).intValue() <= 0){
//判断账号是否存在
if(!"admin".equals(loginname) && userTokenService.listLoginNameCount(agentcode,loginname).intValue() <= 0){
throw new AuthenticationServiceException("账号不存在!");
}
@ -179,7 +186,7 @@ public class MyAuthenticationProvider implements AuthenticationProvider {
}
//userTokenService.savePasswordMaxRetry(user.getLoginname());
throw new AuthenticationServiceException("账号密码不正确");
throw new AuthenticationServiceException("密码错误");
}
@Override

@ -18,6 +18,20 @@ public interface UserTenantMybatisDao extends BaseMapper<UserTenant> {
* @return
*/
Long listCount(Map<String, Object> query);
/**
*
* @param query otherno
* @return
*/
Long listOthernoCount(Map<String, Object> query);
/**
*
* @param query othernologinname
* @return
*/
Long listLoginNameCount(Map<String, Object> query);
/**
*

@ -40,6 +40,23 @@ public interface UserTenantService extends BaseService<UserTenant> {
* @return
*/
public Long listCount(String otherno,String loginname);
/**
*
* @param otherno
* @return
*/
public Long listOthernoCount(String otherno);
/**
*
* @param otherno
* @param loginname
* @return
*/
public Long listLoginNameCount(String otherno,String loginname);
/**
*

@ -96,6 +96,32 @@ public class UserTenantServiceImpl extends BaseServiceImpl<UserTenantMybatisDao,
query.put("loginname",loginname);
return this.userTenantMybatisDao.listCount(query);
}
/**
*
* @param otherno
* @return
*/
public Long listOthernoCount(String otherno){
Map<String, Object> query = new HashMap<>();
query.put("otherno",otherno);
return this.userTenantMybatisDao.listOthernoCount(query);
}
/**
*
* @param otherno
* @param loginname
* @return
*/
public Long listLoginNameCount(String otherno,String loginname){
Map<String, Object> query = new HashMap<>();
query.put("otherno",otherno);
query.put("loginname",loginname);
return this.userTenantMybatisDao.listLoginNameCount(query);
}
/**
*

@ -393,6 +393,27 @@ public class UserTokenServiceImpl implements UserTokenService {
public Long listCount(String otherno,String loginname){
return userTenantService.listCount(otherno,loginname);
}
/**
*
* @param otherno
* @return
*/
public Long listOthernoCount(String otherno){
return userTenantService.listOthernoCount(otherno);
}
/**
*
* @param otherno
* @param loginname
* @return
*/
public Long listLoginNameCount(String otherno,String loginname){
return userTenantService.listLoginNameCount(otherno,loginname);
}
/**
*

@ -62,6 +62,33 @@
)
</select>
<select id="listOthernoCount" resultType="java.lang.Long" parameterType="java.util.Map">
select
count(ten.ID)
from
S_TENANT_T ten
where
ten.OTHERNO = #{otherno}
</select>
<select id="listLoginNameCount" resultType="java.lang.Long" parameterType="java.util.Map">
select
count(ten.ID)
from
S_TENANT_T ten
where
ten.OTHERNO = #{otherno}
and
ten.ID in (
select ue.TENANTID from
S_USER_T us,
S_USER_TENANT_T ue where us.LOGINNAME = #{loginname}
)
</select>
<select id="listMobileCount" resultType="java.lang.Long" parameterType="java.util.Map">
select
count(ten.ID)

Loading…
Cancel
Save