<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
<%@page import="com.yc.service.demo.DemoIfc" %>
|
<%@page import="com.yc.factory.FactoryBean" %>
|
<%@page import="java.util.List" %>
|
<%@page import="java.util.Map" %>
|
<%@page import="com.yc.service.impl.DBHelper" %>
|
<%@page import="com.yc.entity.SystemConfig" %>
|
<%@page import="java.util.ArrayList" %>
|
<%@page import="com.yc.utils.SessionKey" %>
|
<%@page import="com.yc.multiData.SpObserver" %>
|
<%@page import="me.chanjar.weixin.common.util.http.URIUtil" %>
|
<%@page import="com.yc.sdk.shopping.util.SettingKey" %>
|
<%@page import="com.yc.sdk.shopping.action.Maintaince" %>
|
<%@page import="com.yc.entity.DataSourceEntity" %>
|
<%@page import="com.yc.multiData.MultiDataSource" %>
|
<%@ page trimDirectiveWhitespaces="true" %>
|
<%@page import="java.io.File" %>
|
<%@page import="java.util.Calendar" %>
|
<%@page import="com.yc.entity.AttachmentConfig" %>
|
<%@page import="com.yc.action.panval.InvGet" %>
|
<%@page import="eu.bitwalker.useragentutils.UserAgent" %>
|
<%@page import="com.yc.sdk.weixinmp.util.UserAgentUtil" %>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
<%
|
String dsPath = request.getServletContext().getRealPath("/") + "WEB-INF" + File.separator + "classes" + File.separator + "dataSource" + File.separator + "_dataSource.xml";
|
Calendar date = Calendar.getInstance();
|
int year = date.get(Calendar.YEAR);
|
File file = new File(dsPath);
|
if (!file.exists()) {
|
session.setAttribute(SessionKey.DEMO_REF, SessionKey.DEMO_REF);
|
out.print("<script>alert('请配置正确demo数据源!');window.location.href='/demo/update.jsp?demoConfig=demo';</script>");
|
return;
|
}
|
if (request.getProtocol().compareTo("HTTP/1.0") == 0) {
|
response.setHeader("Pragma", "no-cache");
|
}
|
if (request.getProtocol().compareTo("HTTP/1.1") == 0) {
|
response.setHeader("Cache-Control", "no-cache");
|
}
|
response.setDateHeader("Expires", 0);
|
//String URL = (request.getRequestURL()+"").replace(request.getRequestURI(),"") + request.getContextPath();
|
String dbId = MultiDataSource.getDatabaseId(request);
|
//DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap( request) ;
|
|
String hostUrl = SettingKey.getHostUrl(request);
|
DemoIfc demoIfc = (DemoIfc) FactoryBean.getBean("demo");
|
//List<Map<String, Object>> list=new ArrayList<Map<String, Object>>();
|
//Map<String, DataSourceEntity> list = null ;
|
List<DataSourceEntity> list = null;
|
String domain = com.yc.utils.HtmlUtil.getDomain(hostUrl);
|
|
String meno = "Power By OnBus";
|
String menoUrl = "巴士软件";
|
String copyRight = "OnBus";
|
int iscltSN = 0;
|
|
try {
|
MultiDataSource multiDataSource = (MultiDataSource) FactoryBean.getBean("multiDataSource");
|
//multiDataSource.refreshDataSource(null, domain) ; //先刷新本机的数据源(只刷新 domain 数据源,因为有时候新加了系统,要重启tomcat服务,非常耗时) ,added by johns wang,2018-12-03
|
list = MultiDataSource.getDataSourceMapsByDomainByShowInLoginPage(domain);
|
//Integer expiredDays= 9999; //正数表示已经过期天数
|
String sysType = "";
|
//boolean actived = true ;
|
boolean isAllowLogin = true; //是否允许登录系统
|
if (list != null && list.size() > 0) {
|
sysType = (String) list.get(0).getSystemType();
|
iscltSN = list.get(0).isSaas() ? 1 : 0;
|
int stopCount = 0; //判断当前域名 domain 列表下,是否全部系统已经被停用?
|
for (int i = 0; i < list.size(); i++) {
|
Integer expiredDays = (list.get(i).getExpiredDays() == null ? null : (Integer) list.get(i).getExpiredDays());//过期天数:null或负数表示未过期,正数表示已过期
|
boolean actived = list.get(i).getActived();
|
if (expiredDays != null && expiredDays.intValue() > 0 || !actived) {
|
stopCount++;
|
}
|
}
|
//判断当前域名 domain 列表下,是否全部系统已经被停用?
|
if (stopCount == list.size()) {
|
isAllowLogin = false; //已经全部停用,不允许登录系统
|
}
|
} else {
|
isAllowLogin = false; //已经全部停用,不允许登录系统
|
}
|
if (!"常州".equalsIgnoreCase(sysType)) {
|
meno = "Power By YingChen";
|
menoUrl = "盈晨软件";
|
copyRight = "YingChen";
|
} else {
|
meno = "Power By OnBus";
|
menoUrl = "巴士软件";
|
copyRight = "OnBus";
|
}
|
if (!isAllowLogin) {
|
%>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<script src="<%=hostUrl%>/shopping/view/javascript/jquery/jquery-2.1.1.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/jquery/jquery-2.1.1.min.js")%>"
|
type="text/javascript"></script>
|
<link href="<%=hostUrl%>/shopping/view/javascript/bootstrap/css/bootstrap.min.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/bootstrap/css/bootstrap.min.css")%>"
|
rel="stylesheet" media="screen"/>
|
<script src="<%=hostUrl%>/shopping/view/javascript/bootstrap/js/bootstrap.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/bootstrap/js/bootstrap.min.js")%>"
|
type="text/javascript"></script>
|
<link href="<%=hostUrl%>/shopping/view/javascript/font-awesome/css/font-awesome.min.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/javascript/font-awesome/css/font-awesome.min.css")%>"
|
rel="stylesheet" type="text/css"/>
|
<link href="<%=hostUrl%>/shopping/view/theme/default/stylesheet/googleapisFont.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/theme/default/stylesheet/googleapisFont.css")%>"
|
rel="stylesheet" type="text/css"/>
|
<link href="<%=hostUrl%>/shopping/view/theme/default/stylesheet/stylesheet.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/shopping/view/theme/default/stylesheet/stylesheet.css")%>"
|
rel="stylesheet"/>
|
<script type="text/javascript"
|
src="<%=hostUrl%>/js/index/maintaince.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/maintaince.js")%>"></script>
|
</head>
|
<title>404页面不存在</title>
|
<body>
|
|
<style>
|
.col-center-block {
|
float: none;
|
display: block;
|
margin-left: auto;
|
margin-right: auto;
|
}
|
.onbusLogin_img{
|
margin: 15px 0px 15px 0px;
|
}
|
a{
|
color: #8f8f8f;
|
}
|
</style>
|
<div class="container">
|
<div class="row">
|
<div class="col-md-7 col-center-block" style="height: 300px;">
|
<div class="buttons clearfix" style="margin: 5em 0">
|
<div> </div>
|
<div class="pull-center"></div>
|
<div> </div>
|
<div class="pull-left" style="width: 100%;text-align: center">
|
<h3>系统已过期,请联络服务提供商</h3>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script type="text/javascript">
|
$(function () {
|
maintaince.dbid =<%=dbId%>;
|
maintaince.isStop = 'true';
|
setInterval(maintaince.checkSysIsExpired, 10000);//10秒调用一次
|
//checkSysIsExpired('<%=dbId%>','true'); //检查系统是否停止使用 Added by Johns Wang ,2017-05-26
|
});
|
</script>
|
</body>
|
</html>
|
<%
|
return;
|
}
|
} catch (Exception e) {
|
session.setAttribute(SessionKey.DEMO_REF, SessionKey.DEMO_REF);
|
out.print("<script>alert('请配置正确demo数据源!');window.location.href='/demo/update.jsp?demoConfig=demo';</script>");
|
e.printStackTrace();
|
return;
|
}
|
boolean isEnableValidateCode = "true".equals(SystemConfig.getInstanse().get("isEnableValidateCode"));
|
|
//增加登录后重定向页面功能,added by Johns Wang, 2016-02-17
|
String redirect = request.getParameter("redirect");
|
if (redirect == null) redirect = (String) request.getAttribute("redirect");
|
if (redirect != null) redirect = URIUtil.encodeURIComponent(redirect);
|
|
final String oauth2HostName = AttachmentConfig.get("Oauth2.HostName");
|
%>
|
<html lang="zh-cn">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta name="viewport"
|
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
<meta name="HandheldFriendly" content="true"/>
|
<meta name="renderer" content="webkit"/>
|
<title>ERP管理系统--用户登录</title>
|
<link rel="stylesheet"
|
href="<%=hostUrl%>/style/login.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/login.css")%>"/>
|
<link href="<%=hostUrl%>/shopping/view/javascript/font-awesome/css/font-awesome.min.css" rel="stylesheet"
|
type="text/css"/>
|
<script src="<%=hostUrl %>/js/jquery-1.4.4.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jquery-1.4.4.min.js")%>"
|
type="text/javascript"></script>
|
<script src="<%=hostUrl%>/js/index/maintaince.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/maintaince.js")%>"
|
type="text/javascript"></script>
|
<script src="<%=hostUrl %>/js/index/browser.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/browser.js")%>"
|
type="text/javascript"></script>
|
<script src="<%=hostUrl %>/js/jsencrypt.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jsencrypt.min.js")%>"
|
type="text/javascript"></script>
|
<script src="<%=hostUrl %>/js/index/WebSocketqrLogin.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/index/WebSocketqrLogin.js")%>"
|
type="text/javascript"></script>
|
<script src="<%=hostUrl %>/layui/layui.all.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/layui/layui.all.js")%>"></script>
|
<script src="<%=hostUrl %>/js/loginValidate.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/loginValidate.js")%>"
|
type="text/javascript"></script>
|
</head>
|
<body class="login">
|
<div class="login_m">
|
<div class="login_boder">
|
<div class="login_padding">
|
<div class="login_logo">
|
<img src="" style="width:250px;max-height:95px;"/>
|
</div>
|
<div class="qrcode_login">
|
<span class="tips_img"></span>
|
<span class="qrcodes_img"></span>
|
</div>
|
<div class="login-password">
|
<div class="nav">
|
<span class="nav_tab active">
|
<span>账号登录</span>
|
<i class="active_img"></i>
|
</span>
|
<span class="nav_tab">
|
<span>短信登录</span>
|
<i class="active_img"></i>
|
</span>
|
</div>
|
<div>
|
<div class="login_select"
|
style="display:<%=(list != null && list.size()<=1||iscltSN==1)?"none":"block"%>">
|
<input type="hidden" id="redirect" name="redirect"
|
value="<%= redirect == null||"".equals(redirect) ?"":redirect %>"/>
|
<input type="hidden" id="hostUrl" name="hostUrl" value="<%= hostUrl%>"/>
|
<label>
|
<select class="txt_input select" id="dataName" name="dataName">
|
<%
|
Object sel = session.getAttribute("indexSelected");
|
String val = (sel != null) ? sel.toString() : "";
|
String valIs = "";
|
String selected = "";
|
for (int i = 0; list != null && i < list.size(); i++) {
|
DataSourceEntity dataSourceEntity = list.get(i);
|
|
//Added by Johns Wang,2021-05-24
|
Integer expiredDays = (list.get(i).getExpiredDays() == null ? null : (Integer) list.get(i).getExpiredDays());//过期天数:null或负数表示未过期,正数表示已过期
|
boolean actived = list.get(i).getActived();
|
if (expiredDays != null && expiredDays.intValue() > 0 || !actived) {
|
continue; //如果被停用,则不用显示在下拉列表中
|
}
|
|
selected = "";
|
valIs = dataSourceEntity.getDbId() + "";
|
if (val.equals(valIs) || list.size() == 1 || InvGet.isExistsDatabaseIdByCookie(request, valIs)) {
|
selected = "selected='selected'";
|
}
|
out.print("<option version=\"\" haslogoicon=" + dataSourceEntity.isHasLogoIcon() + " value=\"" + valIs + "\" " + selected + ">" + dataSourceEntity.getSystemID() + "</option>");
|
}
|
%>
|
</select>
|
<i class="select_i"></i>
|
<input type="hidden" id="isonescore" name="isonescore"
|
value="<%=list != null && list.size()==1?valIs:""%>"/>
|
</label>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
<div class="login_form active">
|
<div id="snDiv" class="cltsn" style="display:<%=(iscltSN==0)?"none":"block"%>">
|
<label>
|
<input type="text" id="cltsn" name="cltsn" class="txt_input txt_input2"
|
placeholder="通行证"/>
|
<i class="user_i"></i>
|
</label>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
<div class="name">
|
<label>
|
<input type="text" id="name" name="account" spellcheck="false"
|
class="txt_input txt_input2" placeholder="账号 / 手机号"/>
|
<i class="user_i"></i>
|
</label>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
|
<div class="pwd">
|
<label>
|
<input type="password" name="pwd" id="pwd" class="txt_input" placeholder="登录密码"/>
|
<i class="password_i"></i>
|
</label>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
<%if (isEnableValidateCode) { %>
|
<div class="code">
|
<label>
|
<input type="text" id="code" name="code" placeholder="验证码"
|
class="txt_input txt_input_yzm" maxlength="10"/>
|
<i class="yzm_i"></i>
|
</label>
|
<img id="randomming" src="" title="点击更换验证码" alt="点击更换验证码"/>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
<% } %>
|
</div>
|
|
<div class="login_form">
|
<div class="telephone">
|
<label>
|
<input type="text" id="telephone" name="telephone" class="txt_input txt_input2"
|
placeholder="手机号"/>
|
<i class="tele_i"></i>
|
</label>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
<div class="phoneCode">
|
<label>
|
<input type="text" id="phoneCode" name="phoneCode" placeholder="验证码"
|
class="txt_input txt_input_yzm" maxlength="10"/>
|
<i class="yzm_i"></i>
|
</label>
|
<button class="get_phoneCode">获取验证码</button>
|
<div class="error"><span class="text"></span></div>
|
</div>
|
</div>
|
</div>
|
|
<div class="tips">
|
<i class="fa fa-exclamation-circle"></i>
|
<a href="https://www.google.cn/chrome">推荐您使用谷歌chrome浏览器</a>
|
</div>
|
<div class="login_sub">
|
<label>
|
<input type="button" class="sub_button" name="button" id="sub" value="立即登录" style=""/>
|
</label>
|
</div>
|
<div class="login-footer">
|
<div class="pop-login-sns">
|
<div class="log-inway">
|
<span class="line"></span>
|
<span class="txt">其他登录方式</span>
|
<span class="line"></span>
|
</div>
|
<div class="log-ico log-ico-pc">
|
<a href="javascript:;" class="pop-sns-weixin pop-sns-weixin-pc"><i
|
class="icon-weixin icon-weixin-pc"></i></a>
|
<a href="javascript:;" class="pop-sns-qq pop-sns-qq-pc"><i
|
class="icon-qq icon-qq-pc"></i></a>
|
</div>
|
<div class="log-ico log-ico-m">
|
<a href="javascript:;" class="pop-sns-weixin pop-sns-weixin-m"><i
|
class="icon-weixin icon-weixin-m"></i></a>
|
<a href="javascript:;" class="pop-sns-qq pop-sns-qq-m"><i class="icon-qq icon-qq-m"></i></a>
|
</div>
|
</div>
|
<input type="hidden" id="SessionKey" name="SessionKey" value="<%=SessionKey.DATA_BASE_ID %>"/>
|
<input type="hidden" id="oauth2HostName" name="oauth2HostName" value="<%=oauth2HostName%>"/>
|
</div>
|
</div>
|
<div class="qrcode-logins">
|
<div class="qrcode-main">
|
<div class="qrcode_img"><img src="" alt="" style="width:250px; height:250px;"/>
|
<div class="qrcode_success" style="display:none;height:250px;width:250px"><i></i>
|
<p>扫描成功!</p>
|
<h3>请在手机上根据提示确认登录</h3></div>
|
</div>
|
<div class="qrcode-error">
|
<h3>二维码已失效</h3>
|
<a href="javascript:;" class="qrcode-errora" role="button" style="color:#FFF;">请点击刷新</a>
|
</div>
|
</div>
|
<div class="qrcode-desc"><span>打开<span> 巴士软件APP </span> 扫一扫登录</span></div>
|
</div>
|
</div>
|
</div>
|
<footer>
|
<div class="onbusLogin_img"><img src="/images/login/logo.png" width="100"/></div>
|
<p align="center"><a href="http://www.onbus.cn/" target="_blank"><%= meno %> ©<%= menoUrl %> 2006
|
- <%=year %>
|
</a></p>
|
<p class="footer-info" align="center">
|
<a target="_blank" href="http://www.beian.miit.gov.cn">粤ICP备06017735号-2</a>
|
<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44060402000428">粤公网安备
|
44060402000428号 </a>
|
</p>
|
</footer>
|
</div>
|
</body>
|
</html>
|