diff --git a/src/main/java/com/xkrs/common/account/JwtLoginFilter.java b/src/main/java/com/xkrs/common/account/JwtLoginFilter.java index 2edec01..2b5cc3a 100644 --- a/src/main/java/com/xkrs/common/account/JwtLoginFilter.java +++ b/src/main/java/com/xkrs/common/account/JwtLoginFilter.java @@ -75,8 +75,6 @@ public class JwtLoginFilter extends AbstractAuthenticationProcessingFilter { WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); sysUserService = webApplicationContext.getBean(SysUserService.class); } - //更新用户登录信息 - sysUserService.updateSysUserLogin(auth.getName(), IpUtil.getIpAddr(req)); SysUserEntity userByUserName = sysUserService.getUserByUserName(auth.getName()); response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Credentials", "false"); diff --git a/src/main/java/com/xkrs/controller/SysUserController.java b/src/main/java/com/xkrs/controller/SysUserController.java index 4b0f8da..2d66658 100644 --- a/src/main/java/com/xkrs/controller/SysUserController.java +++ b/src/main/java/com/xkrs/controller/SysUserController.java @@ -2,7 +2,6 @@ package com.xkrs.controller; import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; import com.xkrs.common.encapsulation.PromptMessageEnum; -import com.xkrs.utils.TokenUtil; import com.xkrs.model.qo.SysUserQo; import com.xkrs.model.qo.SysUserReceiveSmsQo; import com.xkrs.model.qo.SysUserRemarkQo; @@ -17,6 +16,7 @@ import com.xkrs.straw.service.SysUserService; import com.xkrs.utils.AliYunSmsUtils; import com.xkrs.utils.ListUtils; import com.xkrs.utils.RandomUtil; +import com.xkrs.utils.TokenUtil; import org.apache.hc.core5.util.TextUtils; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.data.domain.Sort; @@ -57,14 +57,6 @@ public class SysUserController { @Resource private SMSHelper smsHelper; - /** - * 查询Vip用户 - */ - @GetMapping("/selectVipUser") - public String selectVipUser() { - return sysUserService.selectVipUser(); - } - /** * 更新(批量)系统用户信息 * diff --git a/src/main/java/com/xkrs/straw/dao/SysUserDao.java b/src/main/java/com/xkrs/straw/dao/SysUserDao.java index 266992d..e28cd03 100644 --- a/src/main/java/com/xkrs/straw/dao/SysUserDao.java +++ b/src/main/java/com/xkrs/straw/dao/SysUserDao.java @@ -40,13 +40,6 @@ public interface SysUserDao extends JpaRepository, JpaSpeci */ SysUserEntity findByUserName(String userName); - /** - * 更新用户登录信息 - */ - @Modifying - @Query(value = "UPDATE sys_user SET last_entry_time = now(), last_entry_ip = :ipAddress " + "WHERE user_name = :userName ;", nativeQuery = true) - int updateSysUserLogin(@Param("userName") String userName, @Param("ipAddress") String ipAddress); - /** * 软删除系统用户根据id */ diff --git a/src/main/java/com/xkrs/straw/service/SysUserService.java b/src/main/java/com/xkrs/straw/service/SysUserService.java index 8286ea3..b8264e3 100644 --- a/src/main/java/com/xkrs/straw/service/SysUserService.java +++ b/src/main/java/com/xkrs/straw/service/SysUserService.java @@ -11,13 +11,6 @@ import java.util.List; */ public interface SysUserService { - /** - * 查询Vip用户 - * - * @return - */ - String selectVipUser(); - /** * 检查用户名 * @@ -50,15 +43,6 @@ public interface SysUserService { */ SysUserEntity getSysUserByUserName(String userName); - /** - * 用户登录更新 - * - * @param userName - * @param ipAddress - * @return - */ - int updateSysUserLogin(String userName, String ipAddress); - /** * 系统用户更新 * diff --git a/src/main/java/com/xkrs/straw/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/straw/service/impl/SysUserServiceImpl.java index d2884b2..a6c445f 100644 --- a/src/main/java/com/xkrs/straw/service/impl/SysUserServiceImpl.java +++ b/src/main/java/com/xkrs/straw/service/impl/SysUserServiceImpl.java @@ -61,31 +61,6 @@ public class SysUserServiceImpl implements SysUserService { private final Locale locale = LocaleContextHolder.getLocale(); - /** - * 查询Vip用户 - * - * @return - */ - @Override - public String selectVipUser() { - List sysUserList = sysUserDao.findAll(); - List vipSysUserList = new ArrayList<>(); - for (SysUserEntity sysUser : sysUserList) { - if (sysUser.getActiveFlag() != 0) {//被禁用的用户不属于Vip - continue; - } - if ("管理员".equals(sysUser.getAccountType())) {//管理员用户不属于Vip - continue; - } - LocalDateTime sysUserOverDateTime = DateTimeUtil.stringToDateTimeFormatter(sysUser.getOverTime(), DateTimeUtil.COMMON_FORMATTER_DATETIME); - if (sysUserOverDateTime.isBefore(LocalDateTime.now())) {//过期用户不属于Vip - continue; - } - vipSysUserList.add(sysUser); - } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, vipSysUserList, locale); - } - /** * 检查用户名是否存在 * @@ -223,12 +198,6 @@ public class SysUserServiceImpl implements SysUserService { return sysUserDao.selectByUserName(userName); } - @Transactional(rollbackFor = Exception.class) - @Override - public int updateSysUserLogin(String userName, String ipAddress) { - return sysUserDao.updateSysUserLogin(userName, ipAddress); - } - /** * 更新用户 *