| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.domain.SysUserRole1; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import com.ruoyi.service.ZfRegisterService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.time.temporal.Temporal; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 登录校验方法 |
| | |
| | | |
| | | |
| | | |
| | | public boolean endOfLife(String username) { |
| | | SysUser sysUser = userService.selectUserByNickName(username); |
| | | System.out.println("[[[[[[["+sysUser); |
| | | if (sysUser.getPaid() != null && sysUser.getPaid().equals(0) && !"4".equals(sysUser.getStatus())) { |
| | | Date startTime = sysUser.getCreateTime(); |
| | | |
| | | // 安全转换 |
| | | Instant instant = startTime.toInstant(); |
| | | LocalDateTime startDateTime = instant.atZone(ZoneId.systemDefault()).toLocalDateTime(); |
| | | long daysPassed = ChronoUnit.DAYS.between(startDateTime, LocalDateTime.now()); |
| | | |
| | | if (daysPassed > 7) { |
| | | sysUser.setStatus("4"); |
| | | userService.updateUserStatus(sysUser); |
| | | |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | public String login(String nickName, String password, String code, String uuid) |
| | | { |
| | | endOfLife(nickName); |
| | | // 验证码校验 |
| | | validateCaptcha(nickName, code, uuid); |
| | | // 登录前置校验 |
| | |
| | | public void loginPreCheck(String username, String password) |
| | | { |
| | | // 用户名或密码为空 错误 |
| | | System.out.println(username); |
| | | System.out.println("099999999999999999999999999999999999"); |
| | | System.out.println(password); |
| | | if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |