This commit is contained in:
77
2024-05-07 23:27:26 +08:00
parent e421472e5d
commit 517d91a0a8
23 changed files with 53 additions and 74 deletions

View File

@@ -4,6 +4,9 @@ import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.CircleCaptcha;
import cn.hutool.captcha.LineCaptcha;
import cn.hutool.captcha.ShearCaptcha;
import com.ruoyi.component.web.config.properties.CaptchaProperties;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
@@ -14,6 +17,8 @@ import java.awt.*;
*
* @author Lion Li
*/
@AutoConfiguration
@EnableConfigurationProperties(CaptchaProperties.class)
public class CaptchaConfig {
private static final int WIDTH = 160;

View File

@@ -5,7 +5,9 @@ import com.ruoyi.component.web.config.properties.XssProperties;
import com.ruoyi.component.web.filter.RepeatableFilter;
import com.ruoyi.component.web.filter.XssFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -18,6 +20,8 @@ import java.util.Map;
*
* @author Lion Li
*/
@AutoConfiguration
@EnableConfigurationProperties(XssProperties.class)
public class FilterConfig {
@Autowired

View File

@@ -1,6 +1,8 @@
package com.ruoyi.component.web.config;
import cn.hutool.core.util.StrUtil;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.LocaleResolver;
@@ -13,6 +15,7 @@ import java.util.Locale;
*
* @author Lion Li
*/
@AutoConfiguration(before = WebMvcAutoConfiguration.class)
public class I18nConfig {
@Bean

View File

@@ -1,6 +1,7 @@
package com.ruoyi.component.web.config;
import com.ruoyi.component.web.interceptor.PlusWebInvokeTimeInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@@ -14,6 +15,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
*
* @author Lion Li
*/
@AutoConfiguration
public class ResourcesConfig implements WebMvcConfigurer {
@Override

View File

@@ -2,6 +2,7 @@ package com.ruoyi.component.web.config;
import io.undertow.server.DefaultByteBufferPool;
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
@@ -10,6 +11,7 @@ import org.springframework.boot.web.server.WebServerFactoryCustomizer;
*
* @author Lion Li
*/
@AutoConfiguration
public class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
/**

View File

@@ -12,7 +12,6 @@ import org.springframework.stereotype.Component;
* @author Lion Li
*/
@Data
@Component
@ConfigurationProperties(prefix = "captcha")
public class CaptchaProperties {

View File

@@ -2,7 +2,6 @@ package com.ruoyi.component.web.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* xss过滤 配置属性
@@ -10,7 +9,6 @@ import org.springframework.stereotype.Component;
* @author Lion Li
*/
@Data
@Component
@ConfigurationProperties(prefix = "xss")
public class XssProperties {