|
@@ -2,7 +2,10 @@ package cn.efunbox.manage.base.assist.aspect;
|
|
|
|
|
|
import cn.efunbox.manage.base.assist.async.AsyncOperationLogHandler;
|
|
|
import cn.efunbox.manage.base.entity.User;
|
|
|
+import cn.efunbox.manage.base.repository.UserRepository;
|
|
|
+import cn.efunbox.manage.common.utils.Constants;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
|
import org.aspectj.lang.annotation.AfterReturning;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
@@ -15,6 +18,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@Slf4j
|
|
|
@Aspect
|
|
@@ -24,8 +28,12 @@ public class OperationLogAspect {
|
|
|
|
|
|
@Autowired
|
|
|
AsyncOperationLogHandler asyncOperationLogHandler;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate<String,String> redisTemplate;
|
|
|
+
|
|
|
@Autowired
|
|
|
- RedisTemplate redisTemplate;
|
|
|
+ UserRepository userRepository;
|
|
|
|
|
|
@AfterReturning(value = "execution(* cn.efunbox.manage.base.controller..*.*(..))",returning = "retVal")
|
|
|
public void doAfter(JoinPoint joinPoint,Object retVal) throws Throwable {
|
|
@@ -45,8 +53,8 @@ public class OperationLogAspect {
|
|
|
log.error("user token is null !");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- User loginUser = (User) redisTemplate.opsForValue().get(token);
|
|
|
+ User loginUser = (User)JSONObject.toBean(JSONObject.fromObject(redisTemplate.opsForValue().get(Constants.EFUNBOX_ADMIN_TOKEN_PREFIX + token)), User.class);
|
|
|
+// User loginUser = (User) ;
|
|
|
|
|
|
|
|
|
request.setAttribute("userInfo",loginUser);
|