Index: ssts-web/src/main/webapp/logonSSOForCszxyy.jsp =================================================================== diff -u -r20599 -r27735 --- ssts-web/src/main/webapp/logonSSOForCszxyy.jsp (.../logonSSOForCszxyy.jsp) (revision 20599) +++ ssts-web/src/main/webapp/logonSSOForCszxyy.jsp (.../logonSSOForCszxyy.jsp) (revision 27735) @@ -1,3 +1,6 @@ +<%@page import="com.forgon.security.service.SSOAuthenticationService"%> +<%@page import="com.forgon.tools.SpringBeanManger"%> +<%@page import="org.apache.commons.io.IOUtils"%> <%@page import="com.forgon.disinfectsystem.common.CssdUtils"%> <%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> @@ -6,28 +9,15 @@ <%@page import="org.apache.commons.lang.StringUtils"%> <% -ArrayList message = new ArrayList(); -//用户名 -String un = request.getParameter("un"); -//密码 -String up = request.getParameter("up"); -if(StringUtils.isBlank(un)){ - message.add("用户名不能为空"); -}else if(StringUtils.isBlank(up)){ - message.add("密码不能为空"); -} -pageContext.setAttribute("un", un); -pageContext.setAttribute("up", up); -pageContext.setAttribute("message", message); - String companyName = CssdUtils.getSystemSetConfigByName("companyName"); String companyNameStr = ""; if(companyName == null || companyName.equals("forgon")){ - companyNameStr = "©2016 广州孚峻信息技术有限公司 版权所有"; + companyNameStr = "©2018 广州孚峻信息技术有限公司 版权所有"; }else if(companyName.equals("dingxiang")){ - companyNameStr = "©2016 广州丁香软件有限公司 版权所有"; + companyNameStr = "©2018 广州丁香软件有限公司 版权所有"; } session.setAttribute("companyName", companyNameStr); + String project = CssdUtils.getConfigProperty("project"); session.setAttribute("profile", project); @@ -43,7 +33,35 @@ request.setAttribute("logoPath","themes/portalPage/img/logo_dingxiangsoft.png"); } } - + +//用户名 +String un = request.getParameter("j_username"); +//密码 +String up = request.getParameter("j_password"); +if(StringUtils.isNotBlank(un)){ + if(StringUtils.isBlank(up)){ + pageContext.setAttribute("message", "密码不能为空"); + }else{ + //否则提交接口认证 + SSOAuthenticationService authenticationService = + (SSOAuthenticationService)SpringBeanManger.getBean("authenticationService"); + if(authenticationService == null){ + pageContext.setAttribute("message", "未配置认证的bean,请检查!"); + }else{ + boolean validateSuccess = authenticationService.authentication(un,up,""); + if(validateSuccess){ + //如果认证成功,转向至主页() + response.sendRedirect(request.getContextPath() + "/homepage/portalPage.jsp?un=" + un); + }else{ + //否则如果认证不成功,提示认证失败 + pageContext.setAttribute("message", "用户名"+ un +"认证失败,请检查用户名与密码是否正确"); + } + } + } +}else{ + //pageContext.setAttribute("message", "用户名不能为空"); +} + %>
@@ -54,31 +72,33 @@