|  |  |  | 
|---|
|  |  |  | package com.matrix.system.common.interceptor; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.core.constance.MatrixConstance; | 
|---|
|  |  |  | import com.matrix.core.tools.LogUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.StringUtils; | 
|---|
|  |  |  | import com.matrix.core.tools.WebUtil; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysCompany; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  | import org.springframework.web.servlet.HandlerInterceptor; | 
|---|
|  |  |  | import org.springframework.web.servlet.ModelAndView; | 
|---|
|  |  |  | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | LogUtil.debug("匹配到公司{}", company.getComName()); | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 获得请求的域名 | 
|---|
|  |  |  | String host = WebUtil.getRequest().getServerName(); | 
|---|
|  |  |  | //判断是否为debug模式 | 
|---|
|  |  |  | if(MatrixConstance.DEBUG){ | 
|---|
|  |  |  | String debugHost=request.getHeader("debugHost"); | 
|---|
|  |  |  | if(StringUtils.isNotBlank(debugHost)){ | 
|---|
|  |  |  | host=debugHost; | 
|---|
|  |  |  | WebUtil.getSession().removeAttribute(ATTR_COMPANY); | 
|---|
|  |  |  | LogUtil.debug("debugHost={}",host); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 获得请求的域名--由小程序直接传过来companyCode参数对应公司的网址 | 
|---|
|  |  |  | String host = request.getHeader("companyCode"); | 
|---|
|  |  |  | LogUtil.debug("当前请求域名{}", host); | 
|---|
|  |  |  | @SuppressWarnings("unchecked") | 
|---|
|  |  |  | Map<String, SysCompany> companyMap = (Map<String, SysCompany>) WebUtil.getServletContext() | 
|---|