Commit fdeed2aa by wasx8023

1.设置环境变量

parent 005b00b3
......@@ -4,6 +4,7 @@ import com.baosight.hpjx.core.constant.EPCodeConstant;
import com.baosight.hpjx.core.tools.ServletTools;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.xservices.xs.util.LoginUserDetails;
import org.springframework.web.servlet.HandlerInterceptor;
......@@ -29,6 +30,8 @@ public class MyHandlerInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
try {
// 设置环境变量
request.setAttribute("projectEnv", ProjectInfo.getProjectEnv());
// 校验接口权限
boolean isInterfaceAuth = this.checkUserInterfaceAuth(request, response);
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结束前--%>
<script src="${iPlatStaticURL}/kendoui/js/kendo.virtuallist.min.js"></script>
<script src="${iPlatStaticURL}/kendoui/js/kendo.ooxml.min.js"></script>
......@@ -26,6 +20,7 @@
</script>
<script type="text/javascript">
let projectEnv = "${projectEnv}";
console.warn("projectEnv", projectEnv);
</script>
<script src="${ctx}/common/js/common.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