Search in sources :

Example 1 with BizSystemPortal

use of com.jeesuite.gateway.model.BizSystemPortal in project jeesuite-libs by vakinge.

the class GlobalAdditionHandler method beforeAuthorization.

@Override
public void beforeAuthorization(HttpServletRequest request, HttpServletResponse response) {
    // 
    // 客户端标识
    String clientType = null;
    String platformType = null;
    // 域名识别租户
    String tenantId = null;
    String domain = WebUtils.getOriginDomain(request);
    BizSystemPortal portal = CurrentSystemHolder.getSystemPortal(domain);
    if (portal != null) {
        clientType = portal.getClientType();
        platformType = portal.getCode();
        tenantId = portal.getTenantId();
    }
    CurrentRuntimeContext.setTenantId(tenantId);
    // 
    String headerValue = request.getHeader(CustomRequestHeaders.HEADER_CLIENT_TYPE);
    CurrentRuntimeContext.setClientType(StringUtils.defaultIfBlank(headerValue, clientType));
    // 
    headerValue = request.getHeader(CustomRequestHeaders.HEADER_PLATFORM_TYPE);
    CurrentRuntimeContext.setPlatformType(StringUtils.defaultIfBlank(headerValue, platformType));
}
Also used : BizSystemPortal(com.jeesuite.gateway.model.BizSystemPortal)

Aggregations

BizSystemPortal (com.jeesuite.gateway.model.BizSystemPortal)1