疯狂的狮子li
2021-10-11 cbb0c98f987a69ed3d23d30d65799f1b426e32d2
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
@@ -1,10 +1,13 @@
package com.ruoyi.framework.config;
import com.ruoyi.framework.Interceptor.PlusWebInvokeTimeInterceptor;
import com.yomahub.tlog.web.interceptor.TLogWebInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -20,6 +23,14 @@
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 全局链路跟踪拦截器
        registry.addInterceptor(new TLogWebInterceptor());
        // 全局访问性能拦截
        registry.addInterceptor(new PlusWebInvokeTimeInterceptor());
    }
    /**
     * 跨域配置
     */