Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
5e9831a6
Commit
5e9831a6
authored
Sep 11, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.重写登录页
parent
10f49fc0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
0 deletions
+116
-0
login.jsp
src/main/resources/META-INF/resources/login.jsp
+116
-0
No files found.
src/main/resources/META-INF/resources/login.jsp
0 → 100644
View file @
5e9831a6
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.baosight.iplat4j.core.FrameworkInfo" %>
<%@ page import="java.io.File" %>
<%
String domain = FrameworkInfo.getProjectAppTopDomain();
if (domain != null && domain.startsWith(".")) {
domain = domain.substring(1);
%>
<script type="text/javascript">
try {
document.domain = '<%= domain %>';
} catch (ex) {
alert('model not valid[<%= domain %>]');
}
</script>
<%
}
%>
<%
String directmode = request.getParameter("maintain") != null ? request.getParameter("maintain").toString() : "";
RequestDispatcher rd;
String appName = FrameworkInfo.getProjectAppName();
org.springframework.security.core.context.SecurityContextHolder.clearContext();
session.setAttribute("iplat.logout", "1");
session.invalidate();
String entryChoice = FrameworkInfo.getText("entryChoice");
String url = "/DispatchAction.do?efFormEname=ECTM40&nodeId=0000000099999999&nodeType=s&templateType=0";
if (entryChoice.equals("template")) {
//从模板进入登录页面
rd = request.getRequestDispatcher(url);
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
} else if (entryChoice.equals("static")) {
// 从静态页面进入登录页面
// 判断缓存文件是否存在
String requestURL = request.getRequestURL().toString();
String _url = requestURL.substring(0, requestURL.indexOf(request.getContextPath())) + request.getContextPath();
String _urlHtml = "/login.html";
java.io.File file = new java.io.File(request.getRealPath("") + _urlHtml);
if (!file.exists()) {
//生成对应的html静态文件
try {
//+url;
java.io.FileOutputStream blankFile = new java.io.FileOutputStream(request.getRealPath("") + _urlHtml);
blankFile.write(new byte[0]);
java.net.URL requestUrl = new java.net.URL(_url);
System.out.println(_url);
java.net.HttpURLConnection con = (java.net.HttpURLConnection) requestUrl.openConnection();
con.connect();
java.io.FileOutputStream fileout = new java.io.FileOutputStream(request.getRealPath("") + _urlHtml);
byte[] bytes = new byte[1024];
int len = 0;
while ((len = con.getInputStream().read(bytes)) != -1) {
fileout.write(bytes, 0, len);
}
} catch (Exception e) {
e.printStackTrace();
out.print("生成静态html文件出错!");
}
}
File _file = new File(request.getRealPath("") + _urlHtml);
if (_file.length() == 0) {
rd = request.getRequestDispatcher(url);
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
} else {
response.sendRedirect(request.getContextPath() + _urlHtml);
}
} else {
//以正常方式进入登录首页
// rd = request.getRequestDispatcher("iplat-v6-login.jsp");
rd = request.getRequestDispatcher("iPlatV6-login.jsp");
try {
rd.forward(request, response);
} catch (ServletException e1) {
e1.printStackTrace();
} finally {
out.clear();
out = pageContext.pushBody();
}
}
%>
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