Index: ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml
===================================================================
diff -u -r31212 -r31385
--- ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml (.../applicationContext-acegi-security.xml) (revision 31212)
+++ ssts-web/src/main/webapp/WEB-INF/spring/security-standard/applicationContext-acegi-security.xml (.../applicationContext-acegi-security.xml) (revision 31385)
@@ -42,6 +42,7 @@
+
Index: ssts-web/src/main/webapp/logonSSOForSzszyy02.jsp
===================================================================
diff -u
--- ssts-web/src/main/webapp/logonSSOForSzszyy02.jsp (revision 0)
+++ ssts-web/src/main/webapp/logonSSOForSzszyy02.jsp (revision 31385)
@@ -0,0 +1,213 @@
+<%@page import="com.forgon.security.model.User"%>
+<%@page import="com.forgon.disinfectsystem.common.CssdUtils"%>
+<%@page import="com.forgon.security.service.UserManager"%>
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@page import="com.forgon.tools.SpringBeanManger"%>
+<%@page import="com.forgon.tools.Constants"%>
+<%@page import="net.sf.json.JSONObject" %>
+<%@page import="java.io.File" %>
+<%@page import="java.util.ArrayList" %>
+<%@page import="org.apache.commons.lang.StringUtils"%>
+<%@page import="net.sf.json.JSONObject" %>
+
+<%
+ArrayList message = new ArrayList();
+String token = request.getParameter("access_token");
+String code = request.getParameter("code");
+String userName = "";
+String ctxx = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
+UserManager userManager=(UserManager)SpringBeanManger.getBean("userManager");
+if(StringUtils.isNotBlank(code)){
+ // 根据认证code获取应用的访问令牌
+ String accessTokenUrl = "http://172.18.5.21:8099/DTH_SSO/oauth2.0/accessToken";
+ String param = "client_id=vxyP5tT2NTw6&client_secret=sUZ3GorwzTTq&grant_type=authorization_code&redirect_uri=" + ctxx + "/logonSSOForSzszyy02.jsp&code="
+ + code;
+ String result = CssdUtils.sendGetRequest(accessTokenUrl, param, "utf-8");
+ JSONObject json = JSONObject.fromObject(result);
+ String status = json.optString("status");
+ if(StringUtils.equals(status, "-1")){
+ message.add(json.optString("error"));
+ }else{
+ String access_token = json.optString("access_token");
+ // 获取用户信息接口
+ String useUrl = "http://172.18.5.21:8099/DTH_SSO/oauth2.0/profile";
+ param = "access_token=" + access_token;
+ String useResult = CssdUtils.sendGetRequest(useUrl, param, "utf-8");
+ JSONObject useJson = JSONObject.fromObject(useResult);
+ userName = useJson.optString("userCode");
+ }
+} else if(StringUtils.isNotBlank(token)){
+ // 获取用户信息接口
+ String useUrl = "http://172.18.5.21:8099/DTH_SSO/oauth2.0/profile";
+ String param = "access_token=" + token;
+ String useResult = CssdUtils.sendGetRequest(useUrl, param, "utf-8");
+ JSONObject useJson = JSONObject.fromObject(useResult);
+ userName = useJson.optString("userCode");
+}else{
+ // 获取授权码
+ String url = "http://172.18.5.21:8099/DTH_SSO/oauth2.0/authorize";
+ String param = "client_id=vxyP5tT2NTw6&redirect_uri=" + ctxx + "/logonSSOForSzszyy02.jsp&response_type=code&state=123";
+ response.sendRedirect(url + "?" + param);
+}
+
+if(StringUtils.isNotBlank(userName)){
+ User user=userManager.getFirst("name", userName);
+ if(user==null){
+ message.add("用户:"+userName+"不存在");
+ }else{
+ pageContext.setAttribute("barcode", user.getBarcode());
+ }
+}
+
+pageContext.setAttribute("message", message);
+
+String companyName = CssdUtils.getSystemSetConfigByName("companyName");
+String companyNameStr = "";
+if(companyName == null || companyName.equals("forgon")){
+ companyNameStr = "©2021 广州孚峻信息技术有限公司 版权所有";
+}else if(companyName.equals("dingxiang")){
+ companyNameStr = "©2021 广州丁香软件有限公司 版权所有";
+}
+session.setAttribute("companyName", companyNameStr);
+String project = CssdUtils.getConfigProperty("project");
+session.setAttribute("profile", project);
+
+String imgPath = "disinfectsystem/config/" + project + "/img/logo_" + project +".png";
+File file = new File(application.getRealPath("/") + imgPath);
+if(file.exists()){
+ request.setAttribute("logoPath",imgPath);
+}else{
+ if(companyName == null || companyName.equals("forgon")){
+ request.setAttribute("logoPath","themes/portalPage/img/logo_Forgon.png");
+ }else if(companyName.equals("dingxiang")){
+ request.setAttribute("logoPath","themes/portalPage/img/logo_dingxiangsoft.png");
+ }
+}
+
+%>
+
+
+
+
+
+
+
+
+消毒供应质量追溯管理系统
+<%-- --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+