app登录校验
This commit is contained in:
parent
cc78d40b9d
commit
c4056bfcb3
@ -62,18 +62,6 @@ public class AppSignServiceImpl extends BaseAppSignService implements IAppSignSe
|
|||||||
if (userPO == null) {
|
if (userPO == null) {
|
||||||
throw new SearchException("用户不存在");
|
throw new SearchException("用户不存在");
|
||||||
}
|
}
|
||||||
if (userPO.getUserState() == UserStateEnum.UN_EXAMINE.getValue()) {
|
|
||||||
throw new SearchException("用户未审核");
|
|
||||||
}
|
|
||||||
if (userPO.getUserState() == UserStateEnum.UN_PASS.getValue()) {
|
|
||||||
throw new SearchException("用户审核未通过");
|
|
||||||
}
|
|
||||||
if (userPO.getUserState() == UserStateEnum.LOCK.getValue()) {
|
|
||||||
throw new SearchException("用户已锁定");
|
|
||||||
}
|
|
||||||
if (DateUtil.isDateExpired(userPO.getUserExpiredDate())) {
|
|
||||||
throw new UserAuthenticationException("账号已经过期");
|
|
||||||
}
|
|
||||||
if (!passwordEncoder.matches(userPassword, userPO.getUserPassword())) {
|
if (!passwordEncoder.matches(userPassword, userPO.getUserPassword())) {
|
||||||
throw new SearchException("用户名或密码错误");
|
throw new SearchException("用户名或密码错误");
|
||||||
}
|
}
|
||||||
@ -98,11 +86,17 @@ public class AppSignServiceImpl extends BaseAppSignService implements IAppSignSe
|
|||||||
* @param userPO
|
* @param userPO
|
||||||
*/
|
*/
|
||||||
private void userLogin(AppLoginVO appLoginVO, UserPO userPO) throws Exception {
|
private void userLogin(AppLoginVO appLoginVO, UserPO userPO) throws Exception {
|
||||||
if (userPO.getUserState() == 1) {
|
if (userPO.getUserState() == UserStateEnum.UN_EXAMINE.getValue()) {
|
||||||
throw new SearchException("账号已冻结");
|
throw new SearchException("用户未审核");
|
||||||
}
|
}
|
||||||
if (userPO.getUserState() == 2) {
|
if (userPO.getUserState() == UserStateEnum.UN_PASS.getValue()) {
|
||||||
throw new SearchException("账号已锁定");
|
throw new SearchException("用户审核未通过");
|
||||||
|
}
|
||||||
|
if (userPO.getUserState() == UserStateEnum.LOCK.getValue()) {
|
||||||
|
throw new SearchException("用户已锁定");
|
||||||
|
}
|
||||||
|
if (DateUtil.isDateExpired(userPO.getUserExpiredDate())) {
|
||||||
|
throw new UserAuthenticationException("账号已经过期");
|
||||||
}
|
}
|
||||||
LOG.debug("校验设备");
|
LOG.debug("校验设备");
|
||||||
if (!StringUtils.isBlank(appLoginVO.getDeviceNo()) && !appDeviceUserService.canSign(userPO.getUserId(), appLoginVO.getDeviceNo())) {
|
if (!StringUtils.isBlank(appLoginVO.getDeviceNo()) && !appDeviceUserService.canSign(userPO.getUserId(), appLoginVO.getDeviceNo())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user