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

fixed

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