main
吴顺杰 2 months ago
parent 1a6421aaba
commit a9b5a78e88

@ -6,10 +6,18 @@ spring:
druid:
# 主库数据源
master:
#远程
url: jdbc:mysql://192.167.2.56:3306/ying_ji?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC
#公司远程
url: jdbc:mysql://39.101.188.84:3307/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Jichuang@2023
password: Admin123@
#本地
# url: jdbc:mysql://localhost:3306/ying_ji?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: 123456
#远程
# url: jdbc:mysql://192.167.2.56:3306/ying_ji?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC
# username: root
# password: Jichuang@2023
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -59,7 +59,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
active: internet
# 文件上传
servlet:
multipart:
@ -125,6 +125,11 @@ pagehelper:
# Swagger配置
knife4j:
enable: true
production: true
basic:
enable": false
username: yingji
password: Yingji@123.
# 防止XSS攻击

@ -0,0 +1,39 @@
package com.ruoyi.framework.config;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
*
*
* @author wu
* @since 2024/7/29 2:51
*/
@Component
public class AddResponseHeaderFilter extends OncePerRequestFilter {
/**
* Same contract as for {@code doFilter}, but guaranteed to be
* just invoked once per request within a single request thread.
* See {@link #shouldNotFilterAsyncDispatch()} for details.
* <p>Provides HttpServletRequest and HttpServletResponse arguments instead of the
* default ServletRequest and ServletResponse ones.
*
* @param request
* @param response
* @param filterChain
*/
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
response.addHeader("X-Frame-Options", "DENY");
response.addHeader("Strict-Transport-Security", "max-age = 16070400");
response.addHeader("X-XSS-Protection", "1;mode=block");
response.addHeader("X-Content-Type-Options", "nosniff");
filterChain.doFilter(request, response);
}
}
Loading…
Cancel
Save