| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.wxopenidConfig.WxOpenIDAuthenticationToken; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SysLoginService { |
| | | @Autowired |
| | |
| | | * @return 结果 |
| | | */ |
| | | public String login(String username, String password, String code, String uuid, String openId, String dingUserId) { |
| | | log.info("username是否为空:{},password是否为空:{},dingUserId是否为空:{}", username, password, dingUserId); |
| | | //免登 |
| | | if (StringUtils.isNotEmpty(dingUserId)) { |
| | | SysUser sysUser = sysUserMapper.selectUserByDingUserId(dingUserId); |
| | |
| | | } |
| | | |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(username); |
| | | if (sysUser.getErrorNums() >= 3) { |
| | | //获取锁定次数 |
| | | String s = configService.selectConfigByKey("sys.opo.lockpwd"); |
| | | if (sysUser.getErrorNums() >= Integer.valueOf(s)) { |
| | | //校验失败次数 |
| | | throw new BaseException("你的密码输入错误次数过多,请联系管理员处理"); |
| | | } |