%@page import="com.forgon.directory.model.LoginInfo"%> <%@page import="com.forgon.tools.crypto.rsa.RSAEncrypt"%> <%@page import="org.apache.commons.lang.StringUtils"%> <%@ page contentType="text/html; charset=UTF-8" %> <%@ include file="/common/taglibs.jsp" %> <%@page import="com.forgon.disinfectsystem.common.*"%> <%@page import="net.sf.json.JSONObject" %> <%@page import="java.io.File" %> <% HttpSession oldSession = request.getSession(false); String needResetPasswordUserId = null; if(oldSession != null){ if(!oldSession.isNew()){ needResetPasswordUserId = (String)oldSession.getAttribute("needResetPasswordUserId"); } if(needResetPasswordUserId!=null){ oldSession.removeAttribute("needResetPasswordUserId"); } } String logonType = request.getParameter("logonType"); if(logonType != null){ session.setAttribute("logonType", logonType); }else{ //如果未传logonType的参数并且login_error参数不为1时(即直接访问logon.jsp页面且不带logonType参数的情况),则需要删除session中的参数配置 String loginError = request.getParameter("login_error"); if(!StringUtils.equals("1", loginError)){ session.removeAttribute("logonType"); }else{ logonType = (String)session.getAttribute("logonType"); //否则表示登录失败的情况,如果logonType为"expensivegoods" if(StringUtils.equals("expensivegoods", logonType)){ response.sendRedirect(request.getContextPath() + "/logonForExpensiveGoods.jsp?login_error=1"); } } } String flag = request.getParameter(WebConstants.ACCESS_FILE_SYSTEM_OBJECT_FLAG); if(WebConstants.ENABLE_FILE_SYSTEM_OBJECT.equals(flag)){ session.setAttribute(WebConstants.ACCESS_FILE_SYSTEM_OBJECT_FLAG, flag); } { // 是否启用语音识别 String ENABLE_SPEECH_RECOGNITION = request.getParameter(WebConstants.KEY_ENABLE_SPEECH_RECOGNITION); if(ENABLE_SPEECH_RECOGNITION != null){ Cookie cookie = new Cookie("ENABLE_SPEECH_RECOGNITION", ENABLE_SPEECH_RECOGNITION); cookie.setMaxAge(60*60*24*365*10000); //设置cookie有效期10000年 response.addCookie(cookie); //保存cookie }else{ // 从cookie中取值 Cookie cookies[] = request.getCookies(); if(cookies != null){ for(Cookie cookie : cookies){ String name = cookie.getName(); if("ENABLE_SPEECH_RECOGNITION".equals(name)){ ENABLE_SPEECH_RECOGNITION = cookie.getValue(); break; } } } } session.setAttribute(WebConstants.KEY_ENABLE_SPEECH_RECOGNITION, ENABLE_SPEECH_RECOGNITION); } String companyName = CssdUtils.getSystemSetConfigByName("companyName"); String companyNameStr = ""; if(companyName == null || companyName.equals("forgon")){ companyNameStr = "©2020 广州孚峻信息技术有限公司 版权所有"; }else if(companyName.equals("dingxiang")){ companyNameStr = "©2020 广州丁香软件有限公司 版权所有"; } else{ companyNameStr = companyName; } 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"); } } //条码的登录密码 String barcodeLogonPassword = (String)application.getAttribute("barcodeLogonPassword"); if(StringUtils.isBlank(barcodeLogonPassword)){ barcodeLogonPassword = LoginInfo.barcodeLogonDefalutPassword; } //登录密码的rsa公钥 String logonRSAPublicKey = (String)application.getAttribute("logonRSAPublicKey"); if(StringUtils.isBlank(logonRSAPublicKey)){ logonRSAPublicKey = RSAEncrypt.ENCRYPTPUBLICKEY; } //登录密码的rsa私钥 String logonRSAPrivateKey = (String)application.getAttribute("logonRSAPrivateKey"); if(StringUtils.isBlank(logonRSAPrivateKey)){ logonRSAPrivateKey = RSAEncrypt.DECRYPTPRIVATEKEY; } %>