请求头重命名:原Header名称 __ajax、__sid、__remember,更改为 x-ajax, x-token,

x-remember(升级注意);新增
ajaxParamName、ajaxHeaderName、contentSecurityPolicy、sessionIdHeaderName、writeCookieParamName、rememberMeHeaderName
参数设置,使用方法详见 yml 注释
This commit is contained in:
thinkgem
2021-05-17 14:56:12 +08:00
parent c4bdc8d643
commit d3518144c9
4 changed files with 152 additions and 104 deletions

View File

@@ -309,12 +309,12 @@ gen:
# 系统监控
state:
enabled: true
#======================================#
#========= Framework settings =========#
#======================================#
# Shiro 相关配置
# Shiro 相关
shiro:
#索引页路径
@@ -354,9 +354,9 @@ shiro:
# 指定获取客户端IP的Header名称防止IP伪造。指定为空则使用原生方法获取IP。
remoteAddrHeaderName: X-Forwarded-For
# 允许的请求方法设定,解决安全审计问题
allowRequestMethods: GET,POST,OPTIONS,PUT,DELETE
# 允许的请求方法设定,解决安全审计问题BPM设计器用到了PUT或DELETE方法
allowRequestMethods: GET, POST, OPTIONS, PUT, DELETE
# 是否允许账号多地登录如果设置为false同一个设备类型的其它地点登录的相同账号被踢下线
isAllowMultiAddrLogin: true
@@ -370,21 +370,22 @@ shiro:
# 是否允许嵌入到外部网站iframe中true不限制false不允许
isAllowExternalSiteIframe: true
# 是否允许跨域访问 CORS如果允许设置允许的域名。当设置'*'号全部域名时accessControlAllowCredentials应该设置为false。
# v4.2.3 开始支持多个域名和模糊匹配例如http://*.jeesite.com,http://*.jeesite.net
# accessControlAllowOrigin: http://demo.jeesite.com
# accessControlAllowOrigin: '*'
# 允许跨域访问时 CORS可以使用的方法和标头
# accessControlAllowMethods: GET, POST, OPTIONS
# accessControlAllowHeaders: Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
# 是否允许接收跨域的Cookie凭证数据 CORS当设置为true时accessControlAllowOrigin不能设置为'*'。
# accessControlAllowCredentials: false
# 设定允许获取的资源列表v4.2.3
#contentSecurityPolicy: "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; img-src 'self' 'unsafe-inline' 'unsafe-eval' data:"
# 是否允许跨域访问 CORS如果允许设置允许的域名。v4.2.3 开始支持多个域名和模糊匹配例如http://*.jeesite.com,http://*.jeesite.net
accessControlAllowOrigin: '*'
# 允许跨域访问时 CORS可以获取和返回的方法和请求头
#accessControlAllowMethods: GET, POST, OPTIONS
#accessControlAllowHeaders: content-type, x-requested-with, x-ajax, x-token, x-remember
#accessControlExposeHeaders: x-remember
# 是否允许接收跨域的Cookie凭证数据 CORS
#accessControlAllowCredentials: false
# 允许的网站来源地址,不设置为全部地址(避免一些跨站点请求伪造 CSRF、防盗链
# allowReferers: http://127.0.0.1,http://localhost
# allowReferers: ~
#allowReferers: http://127.0.0.1,http://localhost
# 是否在登录后生成新的Session默认false
isGenerateNewSessionAfterLogin: false
@@ -406,6 +407,8 @@ shiro:
# ${adminPath}/sys/corpAdmin/treeData = anon
# ${adminPath}/${spring.application.name}/swagger/** = anon
# ${adminPath}/** = user
# URI 权限过滤器定义(自定义添加参数时,请不要移除 ${adminPath}/** = user否则会导致权限异常
filterChainDefinitions: |
${adminPath}/** = user
@@ -460,8 +463,16 @@ session:
#sessionIdCookieHttpOnly: true
#sessionIdCookieSameSite: LAX
# 设置接收SessionId请求参数的名称
# 设置接收 SessionId 请求参数和请求头的名称
sessionIdParamName: __sid
sessionIdHeaderName: x-token
# 当直接通过 __sid 参数浏览器访问页面时,可将直接将 __sid 写入 Cookie 应用于后面的访问
# 访问地址举例http://host/js/a/index?__sid=123456&__cookie=true
writeCookieParamName: __cookie
# 记住我的请求参数和请求头的名称v4.2.3
rememberMeHeaderName: x-remember
# 系统缓存配置
j2cache:
@@ -513,6 +524,10 @@ mybatis:
# Web 相关
web:
# AJAX 接受参数名和请求头名v4.3.0
ajaxParamName: __ajax
ajaxHeaderName: x-ajax
# MVC 视图相关
view:
@@ -528,7 +543,7 @@ web:
favorPathExtension: false
# 使用 __ajax=json、__ajax=xml 后缀匹配返回视图数据
favorParameter: true
# 使用 __ajax=json、__ajax=xml 请求头匹配返回视图数据
# 使用 x-ajax=json、x-ajax=xml 请求头匹配返回视图数据
favorHeader: true
# MVC 拦截器
@@ -578,6 +593,7 @@ web:
# 默认不启用(为兼用旧版保留,建议使用 CORS
jsonp:
enabled: false
callback: __callback
# 核心模块的Web功能仅作为微服务时设为false
core:
@@ -600,7 +616,7 @@ file:
enabled: true
# 文件上传根路径设置路径中不允许包含“userfiles”在指定目录中系统会自动创建userfiles目录如果不设置默认为contextPath路径
# baseDir: D:/jeesite
#baseDir: D:/jeesite
# 上传文件的相对路径支持yyyy, MM, dd, HH, mm, ss, E
uploadPath: '{yyyy}{MM}/'
@@ -638,7 +654,7 @@ video:
# 视频格式转换 ffmpeg.exe 所放的路径
ffmpegFile: d:/tools/video/ffmpeg-4.9/bin/ffmpeg.exe
# ffmpegFile: d:/tools/video/libav-10.6-win64/bin/avconv.exe
#ffmpegFile: d:/tools/video/libav-10.6-win64/bin/avconv.exe
# 视频格式转换 mencoder.exe 所放的路径
mencoderFile: d:/tools/video/mencoder-4.9/mencoder.exe