| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.data.redis.core.StringRedisTemplate;
|
| | | import org.springframework.data.redis.core.ValueOperations;
|
| | | import org.springframework.security.access.ConfigAttribute;
|
| | |
| | | private StringRedisTemplate stringRedisTemplate;
|
| | | @Resource
|
| | | private UserService userService;
|
| | |
|
| | | // 记录特定日志的声明
|
| | | private final Logger newLogger = LoggerFactory.getLogger("requestLog");
|
| | | /**
|
| | | * 获取当前url对应的角色
|
| | | *
|
| | |
| | | List<ConfigAttribute> configAttributes = new ArrayList<>();
|
| | | String requestUrl = ((FilterInvocation)o).getRequestUrl();
|
| | | log.info("接口请求地址【{}】", requestUrl);
|
| | | try {
|
| | | String remoteHost = ((FilterInvocation)o).getRequest().getRemoteHost();
|
| | | newLogger.info("IP:{},接口请求地址【{}】", remoteHost, requestUrl);
|
| | | } catch (Exception e) {
|
| | | log.info("zuul 访问信息解析错误:【{}】", e.getMessage());
|
| | | }
|
| | | Boolean aBoolean = stringRedisTemplate.hasKey(SecurityConstants.ROLE_ALL);
|
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
|
| | | List<MenuVO> menuVOS = new ArrayList<>();
|