Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hp-smart
Commits
fdeed2aa
Commit
fdeed2aa
authored
Mar 13, 2024
by
wasx8023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.设置环境变量
parent
005b00b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
MyHandlerInterceptor.java
.../baosight/hpjx/core/interceptor/MyHandlerInterceptor.java
+3
-0
foot.jsp
...n/resources/META-INF/resources/WEB-INF/fragments/foot.jsp
+1
-6
No files found.
src/main/java/com/baosight/hpjx/core/interceptor/MyHandlerInterceptor.java
View file @
fdeed2aa
...
...
@@ -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
)
{
...
...
src/main/resources/META-INF/resources/WEB-INF/fragments/foot.jsp
View file @
fdeed2aa
<%@ 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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment