diff --git a/login-app/src/main/java/ink/wgink/login/app/service/appsign/impl/AppSignServiceImpl.java b/login-app/src/main/java/ink/wgink/login/app/service/appsign/impl/AppSignServiceImpl.java index 673606b5..15c2deca 100644 --- a/login-app/src/main/java/ink/wgink/login/app/service/appsign/impl/AppSignServiceImpl.java +++ b/login-app/src/main/java/ink/wgink/login/app/service/appsign/impl/AppSignServiceImpl.java @@ -62,18 +62,6 @@ public class AppSignServiceImpl extends BaseAppSignService implements IAppSignSe if (userPO == null) { 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())) { throw new SearchException("用户名或密码错误"); } @@ -98,11 +86,17 @@ public class AppSignServiceImpl extends BaseAppSignService implements IAppSignSe * @param userPO */ private void userLogin(AppLoginVO appLoginVO, UserPO userPO) throws Exception { - if (userPO.getUserState() == 1) { - throw new SearchException("账号已冻结"); + if (userPO.getUserState() == UserStateEnum.UN_EXAMINE.getValue()) { + throw new SearchException("用户未审核"); } - if (userPO.getUserState() == 2) { - 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("账号已经过期"); } LOG.debug("校验设备"); if (!StringUtils.isBlank(appLoginVO.getDeviceNo()) && !appDeviceUserService.canSign(userPO.getUserId(), appLoginVO.getDeviceNo())) {