ludc
2023-06-15 e14d495581896374cc4be7ec929feb95005e6563
Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java
@@ -309,6 +309,7 @@
      }
      //获取用户采用的密码策略
      Strategy strategy = sysClient.getByUserId(userId).getData();
      // 几乎不会出现这种情况
      if(ObjectUtil.isEmpty(strategy)) {
         throw new ServiceException("当前用户未应用密码策略!");
      }
@@ -323,7 +324,7 @@
         if(reqType>=strategy.getRequiredType()){
            break;
         }
         if(!Func.isEmpty(RegexUtil.findResult(regexs.get(i),newPassword1))){
         if(RegexUtil.find(regexs.get(i),newPassword1)){
            reqType++;
         }
      }
@@ -331,12 +332,12 @@
      if(reqType<strategy.getRequiredType()){
         throw new ServiceException(resException);
      }
      // 是否属于组合方式中的类型
      // 是否属于组合方式中的类型,以前是密码必须是包含在组合方式中的类型
      String regex = sysClient.getRegex(Arrays.asList(strategy.getCombinationIds().split(","))).getData();
      regex = "^"+regex+"{"+strategy.getRequiredType()+",}$";
      boolean result = RegexUtil.find(regex, newPassword1);
      if(!result){
         throw new ServiceException(resException);
         throw new ServiceException("密码中只能存在【"+strategy.getCombinationNames()+"】中包含的字符!");
      }
      //修改密码同时,改变用户信息中的密码修改状态字段,密码修改时间
      return this.update(Wrappers.<User>update().lambda()
@@ -422,6 +423,7 @@
      boolean oauthTemp = userOauthService.updateById(userOauth);
      return (userTemp && oauthTemp);
   }
   @Override
   public boolean updatePlatform(Long userId, Integer userType, String userExt) {
      if (userType.equals(UserEnum.WEB.getCategory())) {