🐛 兼容 token 失效情景

This commit is contained in:
ronger 2021-07-10 09:47:23 +08:00
parent ab15640099
commit 837cdec2e6

View File

@ -22,13 +22,11 @@ import org.springframework.web.servlet.HandlerMapping;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* 浏览
*
* @author ronger
*/
@Aspect
@ -43,7 +41,8 @@ public class VisitAspect {
private VisitService visitService;
@Pointcut("@annotation(com.rymcu.forest.core.service.log.annotation.VisitLogger)")
public void pointCut() {}
public void pointCut() {
}
/**
* 保存系统操作日志
@ -71,8 +70,10 @@ public class VisitAspect {
String authHeader = request.getHeader(JwtConstants.AUTHORIZATION);
if (StringUtils.isNotBlank(authHeader)) {
TokenUser tokenUser = UserUtils.getTokenUser(authHeader);
if (Objects.nonNull(tokenUser)) {
visit.setVisitUserId(tokenUser.getIdUser());
}
}
visitService.save(visit);
String methodName = joinPoint.getSignature().getName();