From c4056bfcb32db96c3e438418fe15dc4359f0dc10 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Sat, 7 May 2022 14:34:45 +0800 Subject: [PATCH] =?UTF-8?q?app=E7=99=BB=E5=BD=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appsign/impl/AppSignServiceImpl.java | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) 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())) {