diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java index 4eabc0f..331390b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/system/controller/LoginController.java @@ -429,27 +429,28 @@ public class LoginController { } } + // 暂时移除唯一登录功能 // 删除相同用户名称对应的key - Collection<String> keys = redisTemplate.keys(CommonConstant.PREFIX_USER_TOKEN + "*"); - for (String key : keys) { - String token = (String)redisUtil.get(key); - LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token)); - if (loginUser != null) { - if (oConvertUtils.isNotEmpty(username) && loginUser.getUsername().contains(username)) { - log.info("强制 " + sysUser.getRealname() + " 退出成功! "); - // 清空用户登录Token缓存 - redisUtil.del(token); - // 清空用户登录Token缓存 - redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + token); - // 清空用户登录Shiro权限缓存 - redisUtil.del(CommonConstant.PREFIX_USER_SHIRO_CACHE + sysUser.getId()); - // 清空用户的缓存信息(包括部门信息),例如sys:cache:user::<username> - redisUtil.del(String.format("%s::%s", CacheConstant.SYS_USERS_CACHE, sysUser.getUsername())); - // 调用shiro的logout - SecurityUtils.getSubject().logout(); - } - } - } +// Collection<String> keys = redisTemplate.keys(CommonConstant.PREFIX_USER_TOKEN + "*"); +// for (String key : keys) { +// String token = (String)redisUtil.get(key); +// LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token)); +// if (loginUser != null) { +// if (oConvertUtils.isNotEmpty(username) && loginUser.getUsername().contains(username)) { +// log.info("强制 " + sysUser.getRealname() + " 退出成功! "); +// // 清空用户登录Token缓存 +// redisUtil.del(token); +// // 清空用户登录Token缓存 +// redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + token); +// // 清空用户登录Shiro权限缓存 +// redisUtil.del(CommonConstant.PREFIX_USER_SHIRO_CACHE + sysUser.getId()); +// // 清空用户的缓存信息(包括部门信息),例如sys:cache:user::<username> +// redisUtil.del(String.format("%s::%s", CacheConstant.SYS_USERS_CACHE, sysUser.getUsername())); +// // 调用shiro的logout +// SecurityUtils.getSubject().logout(); +// } +// } +// } // update-end--Author:sunjianlei Date:20210802 for:获取用户租户信息 // 生成token String token = HuahengJwtUtil.sign(username, syspassword, warehouseCode);