| | |
| | | import com.ruoyi.framework.manager.AsyncManager; |
| | | import com.ruoyi.framework.manager.factory.AsyncFactory; |
| | | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TAppUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | // 用户验证 |
| | | Authentication authentication = null; |
| | | // 用户验证 |
| | | TAppUser appUser = appUserService.getOne(Wrappers.<TAppUser>lambdaQuery().eq(TAppUser::getAccount,account)); |
| | | if (StringUtils.isNull(appUser)){ |
| | | log.info("登录用户:{} 不存在.", account); |
| | | throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | } else if (appUser.getDisabled()) { |
| | | log.info("登录用户:{} 已被删除.", account); |
| | | throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | } else if (2 == appUser.getStatus()) { |
| | | log.info("登录用户:{} 已被停用.", account); |
| | | throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | } |
| | | // TAppUser appUser = appUserService.getOne(Wrappers.<TAppUser>lambdaQuery().eq(TAppUser::getAccount,account)); |
| | | // if (StringUtils.isNull(appUser)){ |
| | | // log.info("登录用户:{} 不存在.", account); |
| | | // throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | // } else if (appUser.getDisabled()) { |
| | | // log.info("登录用户:{} 已被删除.", account); |
| | | // throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | // } else if (2 == appUser.getStatus()) { |
| | | // log.info("登录用户:{} 已被停用.", account); |
| | | // throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | // } |
| | | try |
| | | { |
| | | String userName = account + "_2"; |
| | |
| | | */ |
| | | public void recordAppLoginInfo(String userId) |
| | | { |
| | | TAppUser appUser = new TAppUser(); |
| | | appUser.setId(userId); |
| | | // TAppUser appUser = new TAppUser(); |
| | | // appUser.setId(userId); |
| | | // sysUser.setLoginIp(IpUtils.getIpAddr()); |
| | | // sysUser.setLoginDate(DateUtils.getNowDate()); |
| | | // userService.updateUserProfile(sysUser); |