Index: ssts-web/src/main/webapp/logonSSOForBjdxzlyy.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/logonSSOForBjdxzlyy.jsp (revision 0) +++ ssts-web/src/main/webapp/logonSSOForBjdxzlyy.jsp (revision 27144) @@ -0,0 +1,210 @@ +<%@page import="com.itextpdf.text.log.SysoLogger"%> +<%@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="com.forgon.tools.crypto.coder.CoderEncryption" %> +<%@page import="java.io.File" %> +<%@page import="java.util.ArrayList" %> +<%@page import="org.apache.commons.lang.StringUtils"%> +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> + + +<% +ArrayList message = new ArrayList(); +String userName = request.getParameter("userName"); +String time = request.getParameter("loginTime"); +String md5 = request.getParameter("md5"); +//HIS系统和追溯系统约定的salt字符串为:201911070087@ABC +String salt = "201911070087@ABC"; +System.out.println("userName=" + userName + " time=" + time + " md5=" + md5); +if(StringUtils.isNotBlank(userName) || StringUtils.isNotBlank(time) || StringUtils.isNotBlank(md5)){ + try{ + // 请求时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss"); + Date d1 = sdf.parse(time); + long s1 = d1.getTime(); + // 服务器当前时间 + long s2 = System.currentTimeMillis(); + // 检查当前的时间跟传入的时间的间隔,间隔时间不能大于120秒 + if ((s2 - s1) > 120000) { + throw new RuntimeException("请求时间无效"); + } + // 校验md5码 + String md5Str = CoderEncryption.encryptMD5(userName + time + salt, "UTF-8"); + System.out.println(md5Str); + if (!StringUtils.equals(md5, md5Str)) { + throw new RuntimeException("md5码校验出错"); + } + // 查询用户信息 + if(StringUtils.isNotBlank(userName)){ + UserManager userManager=(UserManager)SpringBeanManger.getBean("userManager"); + User user=userManager.getFirst("name", userName); + if(user==null){ + message.add("用户:"+userName+"不存在"); + }else{ + pageContext.setAttribute("barcode", user.getBarcode()); + } + } + } + catch(Exception e) { + message.add(e.getMessage()); + } +}else{ + message.add("参数不能为空"); +} +pageContext.setAttribute("message", message); + +String companyName = CssdUtils.getSystemSetConfigByName("companyName"); +String companyNameStr = ""; +if(companyName == null || companyName.equals("forgon")){ + companyNameStr = "©2016 广州孚峻信息技术有限公司 版权所有"; +}else if(companyName.equals("dingxiang")){ + companyNameStr = "©2016 广州丁香软件有限公司 版权所有"; +} +session.setAttribute("companyName", companyNameStr); +String project = CssdUtils.getConfigProperty("project"); +session.setAttribute("profile", project); + +String imgPath = "disinfectsystem/config/" + project + "/img/logo_" + project +".png"; +//System.out.println(application.getRealPath("/") + imgPath); +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"); + } +} + +%> + +
+ + + + + + +