| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | |
| | | |
| | | /** |
| | | * 在线用户监控 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (Validator.isNotEmpty(ipaddr) && Validator.isNotEmpty(userName)) |
| | | { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr()) && StrUtil.equals(userName, user.getUsername())) |
| | | if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | } |
| | | else if (Validator.isNotEmpty(ipaddr)) |
| | | { |
| | | if (StrUtil.equals(ipaddr, user.getIpaddr())) |
| | | if (StringUtils.equals(ipaddr, user.getIpaddr())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | } |
| | | else if (Validator.isNotEmpty(userName) && Validator.isNotNull(user.getUser())) |
| | | { |
| | | if (StrUtil.equals(userName, user.getUsername())) |
| | | if (StringUtils.equals(userName, user.getUsername())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |