支持配置XSS跨站脚本过滤

This commit is contained in:
RuoYi
2021-07-28 09:58:59 +08:00
parent 3af7af265b
commit 954d208ac6
10 changed files with 886 additions and 7 deletions

View File

@@ -17,19 +17,19 @@ public class CaptchaProperties
/**
* 验证码开关
*/
private boolean enabled;
private Boolean enabled;
/**
* 验证码类型math 数组计算 char 字符)
*/
private String type;
public boolean isEnabled()
public Boolean getEnabled()
{
return enabled;
}
public void setEnabled(boolean enabled)
public void setEnabled(Boolean enabled)
{
this.enabled = enabled;
}

View File

@@ -13,7 +13,7 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "ignore")
@ConfigurationProperties(prefix = "security.ignore")
public class IgnoreWhiteProperties
{
/**

View File

@@ -0,0 +1,48 @@
package com.ruoyi.gateway.config.properties;
import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
/**
* XSS跨站脚本配置
*
* @author ruoyi
*/
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "security.xss")
public class XssProperties
{
/**
* Xss开关
*/
private Boolean enabled;
/**
* 排除路径
*/
private List<String> excludeUrls = new ArrayList<>();
public Boolean getEnabled()
{
return enabled;
}
public void setEnabled(Boolean enabled)
{
this.enabled = enabled;
}
public List<String> getExcludeUrls()
{
return excludeUrls;
}
public void setExcludeUrls(List<String> excludeUrls)
{
this.excludeUrls = excludeUrls;
}
}