| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | |
| | | } |
| | | //获取用户采用的密码策略 |
| | | Strategy strategy = sysClient.getByUserId(userId).getData(); |
| | | if(ObjectUtil.isEmpty(strategy)) { |
| | | throw new ServiceException("当前用户未应用密码策略!"); |
| | | } |
| | | //密码长度校验 |
| | | if(newPassword1.length() < strategy.getMinPwdLen() || newPassword1.length() > strategy.getMaxPwdLen()){ |
| | | throw new ServiceException("密码中必须含有【"+strategy.getCombinationNames()+"】中的【"+strategy.getRequiredType()+"】种密码组合方式,且密码长度必须在【"+strategy.getMinPwdLen()+"-"+strategy.getMaxPwdLen()+"】范围内"); |
| | |
| | | if(adminUserId.equals(userId)){ |
| | | return 0L; |
| | | } |
| | | QueryWrapper<User> wrapper = Wrappers.<User>query().eq("ID", userId); |
| | | //获取到密码修改时间 |
| | | Date pwdUpdateTime = this.getOne(Wrappers.<User>query().eq("ID", userId)).getPwdUpdateTime(); |
| | | Date pwdUpdateTime = this.getOne(wrapper).getPwdUpdateTime(); |
| | | Long pwdupdateday = 0L; |
| | | if(!Func.isEmpty(pwdUpdateTime)){ |
| | | pwdupdateday = dateToDay(pwdUpdateTime); |