mirror of https://github.com/jeecgboot/JimuReport
迁移自定义扩展位置
parent
9a890341e2
commit
d68bc65b90
|
@ -0,0 +1,61 @@
|
|||
package com.jeecg.modules.jmreport.config;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 积木报表子系统切换处理类
|
||||
* @author chenrui
|
||||
* @date 2024/10/31 11:33
|
||||
*/
|
||||
@Component("jimuReportSwitchSysHandler")
|
||||
public class JimuReportSysSwitchFilter implements Filter {
|
||||
|
||||
// 包含积木报表
|
||||
boolean includeJimuReport = false;
|
||||
// 包含积木仪表盘
|
||||
boolean includeJimuDrag = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
Filter.super.init(filterConfig);
|
||||
// 判断是否包含积木报表
|
||||
try {
|
||||
Class.forName("org.jeecg.modules.jmreport.config.JmReportBaseConfig");
|
||||
includeJimuReport = true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
// 判断是否包含积木仪表盘
|
||||
try {
|
||||
Class.forName("org.jeecg.modules.drag.service.IOnlDragCompService");
|
||||
includeJimuDrag = true;
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
if (request instanceof HttpServletRequest) {
|
||||
HttpServletRequest httpRequest = (HttpServletRequest) request;
|
||||
HttpSession session = httpRequest.getSession();
|
||||
if(includeJimuReport) {
|
||||
session.setAttribute("switchJimuReport", "true");
|
||||
}else{
|
||||
session.setAttribute("switchJimuReport", "false");
|
||||
}
|
||||
if(includeJimuDrag) {
|
||||
session.setAttribute("switchJimuDrag", "true");
|
||||
}else {
|
||||
session.setAttribute("switchJimuDrag", "false");
|
||||
}
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.jeecg.modules.jmreport.config;
|
||||
package com.jeecg.modules.jmreport.extend;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
|
@ -1,4 +1,4 @@
|
|||
package com.jeecg.modules.jmreport.config;
|
||||
package com.jeecg.modules.jmreport.extend;
|
||||
|
||||
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
|
||||
import org.springframework.http.HttpHeaders;
|
Loading…
Reference in New Issue