| | |
| | | |
| | | if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) { |
| | | recordLogService.recordLogininfor(request, null, username, Constants.LOGIN_FAIL_STATUS, "登录用户不存在"); |
| | | throw new ServiceException("登录用户:" + username + " 不存在"); |
| | | throw new ServiceException("用户名/密码错误"); |
| | | } |
| | | LoginUser userInfo = userResult.getData(); |
| | | SysUser user = userResult.getData().getSysUser(); |
| | |
| | | retryCount = retryCount + 1; |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); |
| | | redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | | throw new ServiceException("密码错误"); |
| | | throw new ServiceException("用户名/密码错误"); |
| | | } |
| | | else |
| | | { |
| | |
| | | public R<LoginUser> info(@PathVariable("username") String username) { |
| | | SysUser sysUser = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(sysUser)) { |
| | | return R.fail("用户名或密码错误"); |
| | | return R.fail("用户名/密码错误"); |
| | | } |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(sysUser); |
| | |
| | | /** |
| | | * 每天的9点执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 16 * * *") |
| | | @Scheduled(cron = "0 0 9 * * *") |
| | | // @Scheduled(fixedRate = 60000) |
| | | public void taskDay(){ |
| | | try { |
| | |
| | | return access_token; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | System.out.println(getYearAllEnergy("2025","")); |
| | | } |
| | | |
| | | |
| | | |
| | | } |