Commit 0e4b0b03 authored by 喻春霖's avatar 喻春霖

fixed

parents ac7b7d5a 3ea3d50d
......@@ -145,26 +145,28 @@ public class AuthController {
return modelAndView;
}
String loginType = request.getParameter("login_type");
if(StringUtils.isNotEmpty(loginType) && OauthType.getValue(loginType)!=null) {
OauthConfigItem oauthConfigItem = oauthConfig.getItems().get(OauthType.getValue(loginType).getCode());
authLog.setFowardUrl(oauthConfigItem.getOauthUrl());
authLog.setOauthType(OauthType.getValue(loginType).getCode());
// 阅览室日志分离
ClientItem item = clientItemMap.get("readingroomClientId");
authLog.setAuthSource(item.getClientName());
authLogService.save(authLog);
response.sendRedirect(generateLoginUrl(returnUrl, OauthType.getValue(loginType).getCode(), authLog.getId()));
return null;
} else {
authLogService.save(authLog);
String url1 = generateLoginUrl(returnUrl, OauthType.dianjiaoguan.getCode(), authLog.getId());
modelAndView.addObject("loginUrl1", url1);
String url2 = generateLoginUrl(returnUrl, OauthType.edenoperation.getCode(), authLog.getId());
modelAndView.addObject("loginUrl2", url2);
String url3 = generateSpLoginUrl(returnUrl, OauthType.qpjy.getCode(), authLog.getId());
modelAndView.addObject("loginUrl3", url3);
modelAndView.addObject("logId", authLog.getId());
OauthType oauthType = OauthType.getValue(loginType);
if(StringUtils.isNotEmpty(loginType) && oauthType !=null) {
if (StringUtils.isNotEmpty(returnUrl) && returnUrl.contains("readinglab")){
// 阅览室日志分离
ClientItem item = clientItemMap.get("readingroomClientId");
authLog.setAuthSource(item.getClientName());
}
modelAndView.addObject("loginType",loginType);
}else {
modelAndView.addObject("loginType","");
}
authLogService.save(authLog);
String url1 = generateLoginUrl(returnUrl, OauthType.dianjiaoguan.getCode(), authLog.getId());
modelAndView.addObject("loginUrl1", url1);
String url2 = generateLoginUrl(returnUrl, OauthType.edenoperation.getCode(), authLog.getId());
modelAndView.addObject("loginUrl2", url2);
String url3 = generateSpLoginUrl(returnUrl, OauthType.qpjy.getCode(), authLog.getId());
modelAndView.addObject("loginUrl3", url3);
modelAndView.addObject("logId", authLog.getId());
} catch (Exception e) {
e.printStackTrace();
modelAndView.setViewName("error");
......@@ -257,8 +259,13 @@ public class AuthController {
authLog.setAuthSource(clientItem.getClientName());
authLog.setLogType(LogType.logout);
authLogService.save(authLog);
if(StringUtils.isNotEmpty(service))
if(StringUtils.isNotEmpty(service)) {
if (!OauthType.dianjiaoguan.equals(type) && !OauthType.edenoperation.equals(type)){
response.sendRedirect(service);
}
response.sendRedirect(generateLogoutUrl(service, type.name()));
//response.sendRedirect(service);
}
return null;
} catch (Exception e) {
e.printStackTrace();
......@@ -481,6 +488,7 @@ public class AuthController {
//oauthConfig + "/authorize?client_id=testClentId&redirect_uri=http%3a%2f%2f192.168.17.129%3a7774%2fauth%2floginsuccess.do&state=state"
StringBuilder loginUrlBuilder = new StringBuilder();
OauthConfigItem oauthConfigItem = oauthConfig.getItems().get(oauthType);
loginUrlBuilder.append(oauthConfigItem.getOauthUrl());
if (!oauthConfigItem.getOauthUrl().endsWith("/")) {
loginUrlBuilder.append("/");
......
......@@ -5,6 +5,31 @@
<html class="no-js" xmlns:th="http://www.w3.org/1999/xhtml"> <!--<![endif]-->
<head>
<script type="text/javascript" src="../static/js/browser.js"></script>
<script th:inline="javascript">
/*<![CDATA[*/
var loginUrl1 = [[${loginUrl1}]];
var loginUrl2 = [[${loginUrl2}]];
var loginUrl3 = [[${loginUrl3}]];
var logId = [[${logId}]];
var loginType = [[${loginType}]];
var ctxPath = /*[[@{/}]]*/ '';
function toLogin(idp) {
var info = new Browser();
var baseUrl = ctxPath + "auth/tologin?logId="+logId+"&oauthType=";
if (idp=="dianjiaoguan") {
window.location.href = baseUrl+ "dianjiaoguan&loginUrl=" + encodeURIComponent(loginUrl1)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
} else if (idp=="edenoperation") {
window.location.href = baseUrl+ "edenoperation&loginUrl=" + encodeURIComponent(loginUrl2)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
} else {
window.location.href = baseUrl+idp+"&loginUrl=" + encodeURIComponent(loginUrl3+"&auth_source="+idp)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
}
}
if (loginType.length > 0){
toLogin(loginType);
}
</script>
<meta charset="utf-8" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<meta content="" name="description" />
......@@ -14,10 +39,9 @@
<link rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{/static/css/normalize.css}" />
<script type="text/javascript" th:src="@{/static/js/jquery-1.10.2.min.js}"></script>
<script type="text/javascript" src="../static/js/browser.js"></script>
<!--<script src="../js/vendor/modernizr-2.6.2.min.js"></script>-->
</head>
<body>
<body id="body" style="display: none">
<!--[if lt IE 7]>
<p class="browsehappy">
You are using an <strong>outdated</strong> browser. Please
......@@ -39,9 +63,9 @@
<div class="ds-content-city">
<div class="ds-content-city-float">
<p>市认证源</p>
<button onclick="toLogin('szjc')" class="logo-btn city-btn"
<button onclick="toLogin('edenoperation')" class="logo-btn city-btn"
style="background: white url('../static/img/logo-shszjc.png')" type="button"></button>
<button onclick="toLogin('djg')" class="logo-btn city-btn"
<button onclick="toLogin('dianjiaoguan')" class="logo-btn city-btn"
style="background: white url('../static/img/logo-tyrz.png')" type="button"></button>
</div>
</div>
......@@ -51,7 +75,7 @@
<div>
<button onclick="toLogin('qpjy')" class="logo-btn idp-btn" style="background: url('../static/img/logo-qp.png')"
type="button"></button>
<button onclick="toLogin('jsyd')" class="logo-btn idp-btn logo-btn-mask" disabled="disabled"
<button onclick="toLogin('jsjy')" class="logo-btn idp-btn logo-btn-mask" disabled="disabled"
style="background: url('../static/img/logo-js.png')" type="button"></button>
<button onclick="toLogin('hpjy')" class="logo-btn idp-btn logo-btn-mask" disabled="disabled"
style="background: url('../static/img/logo-hp.png')" type="button"></button>
......@@ -78,28 +102,13 @@
<p class="ds-content-text">版权所有&copy;上海教育认证中心</p>
</div>
</div>
<script th:inline="javascript">
/*<![CDATA[*/
var loginUrl1 = [[${loginUrl1}]];
var loginUrl2 = [[${loginUrl2}]];
var loginUrl3 = [[${loginUrl3}]];
var logId = [[${logId}]];
var ctxPath = /*[[@{/}]]*/ '';
/*]]>*/
</script>
<script type="text/javascript">
function toLogin(idp) {
var info = new Browser();
var baseUrl = ctxPath + "auth/tologin?logId="+logId+"&oauthType=";
if (idp=="djg") {
window.location.href = baseUrl+ "dianjiaoguan&loginUrl=" + encodeURIComponent(loginUrl1)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
} else if (idp=="szjc") {
window.location.href = baseUrl+ "edenoperation&loginUrl=" + encodeURIComponent(loginUrl2)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
} else {
window.location.href = baseUrl+idp+"&loginUrl=" + encodeURIComponent(loginUrl3+"&auth_source="+idp)+"&browser="+info.browser+"&device="+info.device+"&os="+info.os+"&version="+info.version;
}
}
</script>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("#body").show();
});
</script>
</html>
......@@ -69,13 +69,11 @@
<div class="statistics-content">
<div style="width: 25%; height: 100%;">
<div class="statistics-content-item item-height">
<p class="statistics-content-item-title">应用来源<span class="statistics-content-item-title-remark">单位:人次</span>
</p>
<p class="statistics-content-item-title">应用来源</p>
<div id="app-source" style="width: 95%;height: calc(100% - 40px); margin: 5px 5px;"></div>
</div>
<div class="statistics-content-item item-height-higher">
<p class="statistics-content-item-title">来源环境分析<span class="statistics-content-item-title-remark">单位:人次</span>
</p>
<p class="statistics-content-item-title">来源环境分析</p>
<div id="app-env-browser" style="width: 95%;height: calc(50% - 30px); margin: 5px 5px;"></div>
<div id="app-env-system" style="width: 95%;height: calc(50% - 30px); margin: 5px 5px;"></div>
</div>
......@@ -113,24 +111,21 @@
</div>
</div>
<div class="statistics-content-item" style="height: 70%;">
<p class="statistics-content-item-title">认证登陆高峰时间<span
class="statistics-content-item-title-remark">单位:人次</span></p>
<p class="statistics-content-item-title">认证登陆高峰时间</p>
<div id="nums-by-time" style="width: 100%; height: calc(100% - 40px); margin: 0;"></div>
</div>
</div>
<div style="width: 25%; height: 100%;">
<div class="statistics-content-item item-height">
<p class="statistics-content-item-title">身份认证<span class="statistics-content-item-title-remark">单位:人次</span>
</p>
<p class="statistics-content-item-title">身份认证</p>
<div id="user-type" style="width: 95%;height: calc(100% - 40px); margin: 5px 5px;"></div>
</div>
<div class="statistics-content-item item-height-higher">
<p class="statistics-content-item-title">认证热点单位<span class="statistics-content-item-title-remark">单位:人次</span>
</p>
<p class="statistics-content-item-title">认证热点单位</p>
<div id="user-org" style="height: calc(100% - 40px); margin-top: 8px;">
<p style="padding: 5px 20px 0 20px; color: #5f646a; font-size: 12px; line-height: 1.8;" v-for="item in userOrgList"><span
style="color: orange; font-weight: 900; padding-right: 8px;">·</span><span v-text="item.name"></span><span
style="float: right;" v-text="item.count"></span></p>
style="float: right;" v-text="item.count + ' 人次'"></span></p>
</div>
</div>
</div>
......@@ -225,7 +220,7 @@
var option = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c} ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
},
legend: {
icon: "circle",
......@@ -343,7 +338,7 @@
var optionBrowser = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c} ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
},
legend: {
icon: "circle",
......@@ -391,7 +386,7 @@
var optionSystem = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c} ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
},
legend: {
icon: "circle",
......@@ -519,7 +514,8 @@
label: {
backgroundColor: '#6a7985'
}
}
},
formatter: "{b}: {c}人次 "
},
xAxis: {
type: 'category',
......@@ -591,7 +587,7 @@
var optionUserType = {
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c} ({d}%)"
formatter: "{a} <br/>{b}: {c}人次 ({d}%)"
},
legend: {
icon: "circle",
......
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