提交 b379001c 编写于 作者: misaka's avatar misaka

1

上级 4276652a
......@@ -117,5 +117,5 @@ zuul:
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization<#if sys.getSaaSMode()==4>,srforgid</#if>
- Cookie,Set-Cookie,Authorization
</#if>
......@@ -127,5 +127,5 @@ zuul:
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization<#if sys.getSaaSMode()==4>,srforgid</#if>
- Cookie,Set-Cookie,Authorization
</#if>
\ No newline at end of file
......@@ -80,10 +80,11 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
<#if sys.getSaaSMode()==4>
final String requestOrgId = request.getHeader("srforgid");
if(StringUtils.isEmpty(requestOrgId)){
throw new RuntimeException("无效系统标识");
final String requestSystemId = request.getHeader("srfsystemid");
if(StringUtils.isEmpty(requestOrgId)||StringUtils.isEmpty(requestSystemId)){
throw new RuntimeException("系统标识或组织标识不能为空");
}
UserDetails userDetails = this.userDetailsService.loadUserByUsername("${sys.getCodeName()}",requestOrgId,username);
UserDetails userDetails = this.userDetailsService.loadUserByUsername(requestSystemId,requestOrgId,username);
<#else>
UserDetails userDetails = this.userDetailsService.loadUserByUsername(username);
</#if>
......
......@@ -59,9 +59,6 @@ public class FeignRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
<#if sys.getSaaSMode()==4>
requestTemplate.header("srfsystem","${sys.getCodeName()}");
</#if>
<#if oauth2Enable>
if(requestTemplate.path().matches("/oauth/token")){
return;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册