Forráskód Böngészése

account forbidden

wangyunpeng 2 hónapja
szülő
commit
66bc010fbd

+ 5 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformAccountServiceImpl.java

@@ -47,6 +47,9 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         if (Objects.isNull(account)) {
             throw new CommonException(ExceptionEnum.ACCOUNT_NOT_EXISTS_WRONG);
         }
+        if (account.getStatus() == AccountStatusEnum.FORBIDDEN.getVal()) {
+            throw new CommonException(ExceptionEnum.ACCOUNT_BANNED);
+        }
         Long now = System.currentTimeMillis();
         if (StringUtils.hasText(param.getPassword())) {
             String password = Arrays.toString(Base64.getDecoder().decode(param.getPassword()));
@@ -164,6 +167,8 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         account.setUpdateAccount(param.getOperator());
         account.setUpdateTimestamp(System.currentTimeMillis());
         accountMapper.updateByPrimaryKeySelective(account);
+        // 清除token
+        redisUtils.del("login." + account.getToken());
     }
 
     @Override