Commit fdeed2aa by wasx8023

1.设置环境变量

parent 005b00b3
...@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.constant.EPCodeConstant; ...@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.constant.EPCodeConstant;
import com.baosight.hpjx.core.tools.ServletTools; import com.baosight.hpjx.core.tools.ServletTools;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtils; import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext; import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.xservices.xs.util.LoginUserDetails; import com.baosight.xservices.xs.util.LoginUserDetails;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
...@@ -29,6 +30,8 @@ public class MyHandlerInterceptor implements HandlerInterceptor { ...@@ -29,6 +30,8 @@ public class MyHandlerInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
try { try {
// 设置环境变量
request.setAttribute("projectEnv", ProjectInfo.getProjectEnv());
// 校验接口权限 // 校验接口权限
boolean isInterfaceAuth = this.checkUserInterfaceAuth(request, response); boolean isInterfaceAuth = this.checkUserInterfaceAuth(request, response);
if (!isInterfaceAuth) { if (!isInterfaceAuth) {
......
<%@ page import="com.baosight.iplat4j.core.ProjectInfo" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String projectEnv = ProjectInfo.getProjectEnv().toLowerCase();
%>
<c:set var="projectEnv" value="<%=projectEnv%>"/>
<%--html body结束前--%> <%--html body结束前--%>
<script src="${iPlatStaticURL}/kendoui/js/kendo.virtuallist.min.js"></script> <script src="${iPlatStaticURL}/kendoui/js/kendo.virtuallist.min.js"></script>
<script src="${iPlatStaticURL}/kendoui/js/kendo.ooxml.min.js"></script> <script src="${iPlatStaticURL}/kendoui/js/kendo.ooxml.min.js"></script>
...@@ -26,6 +20,7 @@ ...@@ -26,6 +20,7 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
let projectEnv = "${projectEnv}"; let projectEnv = "${projectEnv}";
console.warn("projectEnv", projectEnv);
</script> </script>
<script src="${ctx}/common/js/common.js"></script> <script src="${ctx}/common/js/common.js"></script>
<script src="${ctx}/common/js/jsUtils.js"></script> <script src="${ctx}/common/js/jsUtils.js"></script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment