首页 > 其他分享 >atools -> log -> interceptor -> InterceptorConfig

atools -> log -> interceptor -> InterceptorConfig

时间:2022-08-30 09:35:38浏览次数:34  
标签:log atools InterceptorConfig import interceptor annotation

atools -> log -> interceptor -> InterceptorConfig 文件

package com.example.demo.atools.log.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @Create: IntelliJ IDEA.
 * @Author: subtlman_ljx
 * @Date: 2020/09/09/9:22
 * @Description: 拦截请求
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Resource
    MyInterceptor myInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /**
         * 在 WebConfigurer 中的 addInterceptors 中添加拦截,放行
         * addPathPatterns("/**") 表示拦截所有的请求,
         * excludePathPatterns("/login", "/register") 表示对登录注册放行 TODO
         */
        registry.addInterceptor(myInterceptor).addPathPatterns("/**").excludePathPatterns("/login", "/register");
    }

}

 

标签:log,atools,InterceptorConfig,import,interceptor,annotation
From: https://www.cnblogs.com/subtlman/p/16638150.html

相关文章

  • atools -> log -> interceptor -> MyInterceptor
    atools->log->interceptor->MyInterceptor 文件packagecom.example.demo.atools.log.interceptor;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;......
  • atools -> readme.txt
    atools->readme.txt 文件atools生命历程***2020/09/09***1、工具包处于测试阶段2、测试出现的问题:swagger不能正常显示、入参的参数body不能获取到3、计划引入切......
  • atools -> resp -> DomainException
    DomainException类文件packagecom.example.demo.atools.resp;/***@Create:IntelliJIDEA.*@Author:subtlman_ljx*@Date:2020/09/09/9:22*@Descriptio......
  • atools -> resp -> MyHandlerExceptionResolver
    MyHandlerExceptionResolver类文件packagecom.example.demo.atools.resp;importorg.springframework.web.bind.annotation.ExceptionHandler;importorg.springfram......
  • atools -> resp -> ServiceResp
    ServiceResp类文件packagecom.example.demo.atools.resp;/***@Create:IntelliJIDEA.*@Author:subtlman_ljx*@Date:2020/09/09/9:22*@Description:......
  • atools -> config -> AutoBean
    AutoBean类文件packagecom.example.demo.atools.config;importorg.springframework.beans.BeansException;importorg.springframework.context.ApplicationContext......
  • atools -> config -> SwaggerConfig
    SwaggerConfig类文件packagecom.example.demo.atools.config;importorg.springframework.context.annotation.Bean;importorg.springframework.context.annotation......