update
This commit is contained in:
@@ -9,20 +9,15 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.*;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
import org.jeecg.common.api.dto.LogDTO;
|
import org.jeecg.common.api.dto.LogDTO;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
import org.jeecg.common.constant.CommonConstant;
|
||||||
import org.jeecg.common.constant.enums.ModuleType;
|
import org.jeecg.common.constant.enums.*;
|
||||||
import org.jeecg.common.constant.enums.OperateTypeEnum;
|
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.IpUtils;
|
import org.jeecg.common.util.*;
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.springframework.core.StandardReflectionParameterNameDiscoverer;
|
import org.springframework.core.StandardReflectionParameterNameDiscoverer;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -32,7 +27,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统日志,切面处理类
|
* 系统日志,切面处理类
|
||||||
*
|
*
|
||||||
@@ -88,7 +82,6 @@ public class AutoLogAspect {
|
|||||||
String methodName = signature.getName();
|
String methodName = signature.getName();
|
||||||
dto.setMethod(className + "." + methodName + "()");
|
dto.setMethod(className + "." + methodName + "()");
|
||||||
|
|
||||||
|
|
||||||
//设置操作类型
|
//设置操作类型
|
||||||
if (CommonConstant.LOG_TYPE_2 == dto.getLogType()) {
|
if (CommonConstant.LOG_TYPE_2 == dto.getLogType()) {
|
||||||
dto.setOperateType(getOperateType(methodName, syslog.operateType()));
|
dto.setOperateType(getOperateType(methodName, syslog.operateType()));
|
||||||
@@ -110,11 +103,20 @@ public class AutoLogAspect {
|
|||||||
//耗时
|
//耗时
|
||||||
dto.setCostTime(time);
|
dto.setCostTime(time);
|
||||||
dto.setCreateTime(new Date());
|
dto.setCreateTime(new Date());
|
||||||
|
try {
|
||||||
|
//设置客户端
|
||||||
|
if (BrowserUtils.isDesktop(request)) {
|
||||||
|
dto.setClientType(ClientTerminalTypeEnum.PC.getKey());
|
||||||
|
} else {
|
||||||
|
dto.setClientType(ClientTerminalTypeEnum.APP.getKey());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
//e.printStackTrace();
|
||||||
|
}
|
||||||
//保存系统日志
|
//保存系统日志
|
||||||
baseCommonService.addLog(dto);
|
baseCommonService.addLog(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取操作类型
|
* 获取操作类型
|
||||||
*/
|
*/
|
||||||
@@ -138,15 +140,20 @@ public class AutoLogAspect {
|
|||||||
private String getReqestParams(HttpServletRequest request, JoinPoint joinPoint) {
|
private String getReqestParams(HttpServletRequest request, JoinPoint joinPoint) {
|
||||||
String httpMethod = request.getMethod();
|
String httpMethod = request.getMethod();
|
||||||
String params = "";
|
String params = "";
|
||||||
if (CommonConstant.HTTP_POST.equals(httpMethod) || CommonConstant.HTTP_PUT.equals(httpMethod) || CommonConstant.HTTP_PATCH.equals(httpMethod)) {
|
if (CommonConstant.HTTP_POST.equals(httpMethod) || CommonConstant.HTTP_PUT.equals(httpMethod) || CommonConstant.HTTP_PATCH.equals(
|
||||||
|
httpMethod)) {
|
||||||
Object[] paramsArray = joinPoint.getArgs();
|
Object[] paramsArray = joinPoint.getArgs();
|
||||||
// java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
|
// java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e
|
||||||
|
// . isAsyncStarted() returns false)
|
||||||
// https://my.oschina.net/mengzhang6/blog/2395893
|
// https://my.oschina.net/mengzhang6/blog/2395893
|
||||||
Object[] arguments = new Object[paramsArray.length];
|
Object[] arguments = new Object[paramsArray.length];
|
||||||
for (int i = 0; i < paramsArray.length; i++) {
|
for (int i = 0; i < paramsArray.length; i++) {
|
||||||
if (paramsArray[i] instanceof BindingResult || paramsArray[i] instanceof ServletRequest || paramsArray[i] instanceof ServletResponse || paramsArray[i] instanceof MultipartFile) {
|
if (paramsArray[i] instanceof BindingResult || paramsArray[i] instanceof ServletRequest
|
||||||
//ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
|
|| paramsArray[i] instanceof ServletResponse || paramsArray[i] instanceof MultipartFile) {
|
||||||
//ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for this response
|
//ServletRequest不能序列化,从入参里排除,否则报异常:java.lang.IllegalStateException: It is illegal to call this method if the current
|
||||||
|
// request is not in asynchronous mode (i.e. isAsyncStarted() returns false)
|
||||||
|
//ServletResponse不能序列化 从入参里排除,否则报异常:java.lang.IllegalStateException: getOutputStream() has already been called for
|
||||||
|
// this response
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
arguments[i] = paramsArray[i];
|
arguments[i] = paramsArray[i];
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package org.jeecg.modules.base.service;
|
|||||||
import org.jeecg.common.api.dto.LogDTO;
|
import org.jeecg.common.api.dto.LogDTO;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* common接口
|
* common接口
|
||||||
*
|
*
|
||||||
@@ -25,7 +27,7 @@ public interface BaseCommonService {
|
|||||||
* @param operateType
|
* @param operateType
|
||||||
* @param user
|
* @param user
|
||||||
*/
|
*/
|
||||||
void addLog(String logContent, Integer logType, Integer operateType, LoginUser user);
|
void addLog(String logContent, Integer logType, Integer operateType, LoginUser user, Date beginTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存日志
|
* 保存日志
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import org.apache.shiro.SecurityUtils;
|
|||||||
import org.jeecg.common.api.dto.LogDTO;
|
import org.jeecg.common.api.dto.LogDTO;
|
||||||
import org.jeecg.common.constant.enums.ClientTerminalTypeEnum;
|
import org.jeecg.common.constant.enums.ClientTerminalTypeEnum;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
import org.jeecg.common.util.BrowserUtils;
|
import org.jeecg.common.util.*;
|
||||||
import org.jeecg.common.util.IpUtils;
|
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.base.mapper.BaseCommonMapper;
|
import org.jeecg.modules.base.mapper.BaseCommonMapper;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -45,7 +42,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addLog(String logContent, Integer logType, Integer operatetype, LoginUser user) {
|
public void addLog(String logContent, Integer logType, Integer operatetype, LoginUser user, Date beginTime) {
|
||||||
LogDTO sysLog = new LogDTO();
|
LogDTO sysLog = new LogDTO();
|
||||||
sysLog.setId(String.valueOf(IdWorker.getId()));
|
sysLog.setId(String.valueOf(IdWorker.getId()));
|
||||||
//注解上的描述,操作日志内容
|
//注解上的描述,操作日志内容
|
||||||
@@ -84,6 +81,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
|
|||||||
sysLog.setUsername(user.getRealname());
|
sysLog.setUsername(user.getRealname());
|
||||||
}
|
}
|
||||||
sysLog.setCreateTime(new Date());
|
sysLog.setCreateTime(new Date());
|
||||||
|
sysLog.setCostTime(System.currentTimeMillis() - beginTime.getTime());
|
||||||
//保存日志(异常捕获处理,防止数据太大存储失败,导致业务失败)JT-238
|
//保存日志(异常捕获处理,防止数据太大存储失败,导致业务失败)JT-238
|
||||||
try {
|
try {
|
||||||
baseCommonMapper.saveLog(sysLog);
|
baseCommonMapper.saveLog(sysLog);
|
||||||
@@ -95,8 +93,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addLog(String logContent, Integer logType, Integer operateType) {
|
public void addLog(String logContent, Integer logType, Integer operateType) {
|
||||||
addLog(logContent, logType, operateType, null);
|
addLog(logContent, logType, operateType, null, new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.constant.CacheConstant;
|
import org.jeecg.common.constant.*;
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
|
||||||
import org.jeecg.common.constant.SymbolConstant;
|
|
||||||
import org.jeecg.common.constant.enums.DySmsEnum;
|
import org.jeecg.common.constant.enums.DySmsEnum;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
import org.jeecg.common.system.vo.LoginUser;
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
@@ -24,9 +22,7 @@ import org.jeecg.common.util.*;
|
|||||||
import org.jeecg.common.util.encryption.EncryptedString;
|
import org.jeecg.common.util.encryption.EncryptedString;
|
||||||
import org.jeecg.config.JeecgBaseConfig;
|
import org.jeecg.config.JeecgBaseConfig;
|
||||||
import org.jeecg.modules.base.service.BaseCommonService;
|
import org.jeecg.modules.base.service.BaseCommonService;
|
||||||
import org.jeecg.modules.system.entity.SysDepart;
|
import org.jeecg.modules.system.entity.*;
|
||||||
import org.jeecg.modules.system.entity.SysRoleIndex;
|
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
|
||||||
import org.jeecg.modules.system.model.SysLoginModel;
|
import org.jeecg.modules.system.model.SysLoginModel;
|
||||||
import org.jeecg.modules.system.service.*;
|
import org.jeecg.modules.system.service.*;
|
||||||
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
|
||||||
@@ -46,25 +42,25 @@ import java.util.*;
|
|||||||
@Tag(name = "用户登录")
|
@Tag(name = "用户登录")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
|
private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService sysUserService;
|
private ISysUserService sysUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysPermissionService sysPermissionService;
|
private ISysPermissionService sysPermissionService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysBaseApiImpl sysBaseApi;
|
private SysBaseApiImpl sysBaseApi;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysLogService logService;
|
private ISysLogService logService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDepartService sysDepartService;
|
private ISysDepartService sysDepartService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictService sysDictService;
|
private ISysDictService sysDictService;
|
||||||
@Resource
|
@Resource
|
||||||
private BaseCommonService baseCommonService;
|
private BaseCommonService baseCommonService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JeecgBaseConfig jeecgBaseConfig;
|
private JeecgBaseConfig jeecgBaseConfig;
|
||||||
|
|
||||||
@Operation(summary = "登录接口")
|
@Operation(summary = "登录接口")
|
||||||
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||||
@@ -78,24 +74,25 @@ public class LoginController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// step.1 验证码check
|
// step.1 验证码check
|
||||||
// String captcha = sysLoginModel.getCaptcha();
|
// String captcha = sysLoginModel.getCaptcha();
|
||||||
// if(captcha==null){
|
// if(captcha==null){
|
||||||
// result.error500("验证码无效");
|
// result.error500("验证码无效");
|
||||||
// return result;
|
// return result;
|
||||||
// }
|
// }
|
||||||
// String lowerCaseCaptcha = captcha.toLowerCase();
|
// String lowerCaseCaptcha = captcha.toLowerCase();
|
||||||
// // 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
|
// // 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可
|
||||||
// String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
|
// String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret();
|
||||||
// String realKey = Md5Util.md5Encode(origin, "utf-8");
|
// String realKey = Md5Util.md5Encode(origin, "utf-8");
|
||||||
// Object checkCode = redisUtil.get(realKey);
|
// Object checkCode = redisUtil.get(realKey);
|
||||||
// //当进入登录页时,有一定几率出现验证码错误 #1714
|
// //当进入登录页时,有一定几率出现验证码错误 #1714
|
||||||
// if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
// if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||||
// log.warn("验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha, checkCode);
|
// log.warn("验证码错误,key= {} , Ui checkCode= {}, Redis checkCode = {}", sysLoginModel.getCheckKey(), lowerCaseCaptcha,
|
||||||
// result.error500("验证码错误");
|
// checkCode);
|
||||||
// // 改成特殊的code 便于前端判断
|
// result.error500("验证码错误");
|
||||||
// result.setCode(HttpStatus.PRECONDITION_FAILED.value());
|
// // 改成特殊的code 便于前端判断
|
||||||
// return result;
|
// result.setCode(HttpStatus.PRECONDITION_FAILED.value());
|
||||||
// }
|
// return result;
|
||||||
|
// }
|
||||||
|
|
||||||
// step.2 校验用户是否存在且有效
|
// step.2 校验用户是否存在且有效
|
||||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -119,17 +116,16 @@ public class LoginController {
|
|||||||
userInfo(sysUser, result, request);
|
userInfo(sysUser, result, request);
|
||||||
|
|
||||||
// step.5 登录成功删除验证码
|
// step.5 登录成功删除验证码
|
||||||
// redisUtil.del(realKey);
|
// redisUtil.del(realKey);
|
||||||
redisUtil.del(CommonConstant.LOGIN_FAIL + username);
|
redisUtil.del(CommonConstant.LOGIN_FAIL + username);
|
||||||
|
|
||||||
// step.6 记录用户登录日志
|
// step.6 记录用户登录日志
|
||||||
LoginUser loginUser = new LoginUser();
|
LoginUser loginUser = new LoginUser();
|
||||||
BeanUtils.copyProperties(sysUser, loginUser);
|
BeanUtils.copyProperties(sysUser, loginUser);
|
||||||
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null, loginUser);
|
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null, loginUser, new Date());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【vue3专用】获取用户信息
|
* 【vue3专用】获取用户信息
|
||||||
*/
|
*/
|
||||||
@@ -189,7 +185,7 @@ public class LoginController {
|
|||||||
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
if (sysUser != null) {
|
if (sysUser != null) {
|
||||||
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
||||||
baseCommonService.addLog("用户名: " + sysUser.getRealname() + ",退出成功!", CommonConstant.LOG_TYPE_1, null, sysUser);
|
baseCommonService.addLog("用户名: " + sysUser.getRealname() + ",退出成功!", CommonConstant.LOG_TYPE_1, null, sysUser,new Date());
|
||||||
//update-end--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
//update-end--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
||||||
log.info(" 用户名: " + sysUser.getRealname() + ",退出成功! ");
|
log.info(" 用户名: " + sysUser.getRealname() + ",退出成功! ");
|
||||||
//清空用户登录Token缓存
|
//清空用户登录Token缓存
|
||||||
@@ -260,7 +256,6 @@ public class LoginController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登陆成功选择用户当前部门
|
* 登陆成功选择用户当前部门
|
||||||
*
|
*
|
||||||
@@ -396,7 +391,6 @@ public class LoginController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号登录接口
|
* 手机号登录接口
|
||||||
*
|
*
|
||||||
@@ -441,7 +435,6 @@ public class LoginController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 用户信息
|
||||||
*
|
*
|
||||||
@@ -698,7 +691,6 @@ public class LoginController {
|
|||||||
return Result.OK("扫码成功");
|
return Result.OK("扫码成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户扫码后保存的token
|
* 获取用户扫码后保存的token
|
||||||
*/
|
*/
|
||||||
@@ -808,7 +800,6 @@ public class LoginController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图形验证码
|
* 图形验证码
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 在线用户
|
* @Description: 在线用户
|
||||||
@@ -112,7 +109,7 @@ public class SysUserOnlineController {
|
|||||||
String username = JwtUtil.getUsername(online.getToken());
|
String username = JwtUtil.getUsername(online.getToken());
|
||||||
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
LoginUser sysUser = sysBaseApi.getUserByName(username);
|
||||||
if (sysUser != null) {
|
if (sysUser != null) {
|
||||||
baseCommonService.addLog("强制: " + sysUser.getRealname() + "退出成功!", CommonConstant.LOG_TYPE_1, null, sysUser);
|
baseCommonService.addLog("强制: " + sysUser.getRealname() + "退出成功!", CommonConstant.LOG_TYPE_1, null, sysUser,new Date());
|
||||||
log.info(" 强制 " + sysUser.getRealname() + "退出成功! ");
|
log.info(" 强制 " + sysUser.getRealname() + "退出成功! ");
|
||||||
//清空用户登录Token缓存
|
//清空用户登录Token缓存
|
||||||
redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + online.getToken());
|
redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + online.getToken());
|
||||||
|
|||||||
Reference in New Issue
Block a user