Commit 78ca6e47 by 周添尉

Merge remote-tracking branch 'origin/develop' into develop

parents f28590bb bc8191fa
......@@ -69,18 +69,17 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://cas.jfbrother.com:8080/cas-test01/login</param-value><!-- cas 服务器登录 地址 http://IP:PORT/CasWebProName/login -->
<param-value>http://cas.jfbrother.com:9003/cas-test01/login</param-value><!-- cas 服务器登录 地址 http://IP:PORT/CasWebProName/login -->
</init-param>
<init-param>
<!-- 这里的server是服务端的IP -->
<param-name>serverName</param-name>
<!--<param-value>http://192.168.1.116:8081</param-value> 客户端服务器地址 http://IP:PORT -->
<param-value>http://192.168.1.123:8080</param-value>
<param-value>http://portal.jfbrother.com:9003</param-value><!-- 客户端服务器地址 http://IP:PORT -->
</init-param>
</filter>
<filter-mapping>
<filter-name>CASFilter</filter-name>
<url-pattern>/cas.jsp</url-pattern>
<url-pattern>/jfcas</url-pattern>
<!-- <url-pattern>/*</url-pattern> -->
</filter-mapping>
......@@ -90,17 +89,16 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>http://cas.jfbrother.com:8080/cas-test01</param-value><!-- cas 服务器地址 http://IP:PORT/CasWebProName -->
<param-value>http://cas.jfbrother.com:9003/cas-test01</param-value><!-- cas 服务器地址 http://IP:PORT/CasWebProName -->
</init-param>
<init-param>
<param-name>serverName</param-name>
<!-- <param-value>http://192.168.1.116:8081</param-value> 客户端服务器地址 http://IP:PORT -->
<param-value>http://192.168.1.123:8080</param-value>
<param-value>http://portal.jfbrother.com:9003</param-value><!-- 客户端服务器地址 http://IP:PORT -->
</init-param>
</filter>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/cas.jsp</url-pattern>
<url-pattern>/jfcas</url-pattern>
</filter-mapping>
<!-- 该过滤器负责实现HttpServletRequest请求的包裹,
......@@ -113,6 +111,20 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 单点注销监听器 -->
<listener>
<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>
<!-- 单点注销过滤器 -->
<filter>
<filter-name>caslogoutFilter</filter-name>
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>caslogoutFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
......@@ -147,7 +159,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>cas.jsp</welcome-file>
</welcome-file-list>
<error-page>
......
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="org.jasig.cas.client.authentication.AttributePrincipal" %>
<%@ page import="org.jasig.cas.client.util.AssertionHolder"%>
<%@ page import="com.gaowj.business.comp.BusinessManager" %>
<%@ page import="com.gaowj.business.SystemOpeBusiness" %>
<%@ page import="com.gaowj.business.util.Java_tool" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Map" %>
<%
//解决在IE的frame/iframe环境下,跨域单点登录后,无法重定向的问题
response.setHeader("P3P","CP=CAO PSA OUR");
%>
<%
AttributePrincipal principal = (AttributePrincipal)request.getUserPrincipal();
Map<String, Object> attributes = principal.getAttributes();
String userID = attributes.get("userid").toString();
String userName = attributes.get("USER_NAME").toString();
System.out.println("-----1"+userID);
System.out.println("-----2"+userName);
System.out.println("-----3"+attributes.get("UNIT_ID"));
if(userID!=null){
String username = userID;
Java_tool jt = new Java_tool();
SystemOpeBusiness systemOpeBusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
Map query = new HashMap();
query.put("EMID", username);
Map<String,Object> userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
Map<String,Object> sessionUser = new HashMap<String,Object>();
String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString());
sessionUser.put("CODE",userInfoI.get("CODE"));
sessionUser.put("EMID",userInfoI.get("EMID"));
sessionUser.put("EMSEX",userInfoI.get("EMSEX"));
sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("SESSIONID", request.getSession().getId());
sessionUser.put("CURRENTTIME", jt.now_datetime());
sessionUser.put("LOGINIP", request.getRemoteAddr());
sessionUser.put("SERVERIP", request.getLocalAddr());
sessionUser.put("QUANXIAN",u_all_m);
request.getSession().setAttribute("userInfo", sessionUser);
//增加登陆日志
Map<String,Object> log = new HashMap<String,Object>();
log.put("CODE", sessionUser.get("CODE"));log.put("EMNAME", sessionUser.get("EMNAME"));log.put("EMIP", sessionUser.get("LOGINIP"));
log.put("OPENAME", "登陆");log.put("OPETIME", jt.String3date((String)sessionUser.get("CURRENTTIME")));log.put("TYPE", userInfoI.get("TYPE"));
log.put("OPETYPE", "B/S登陆");
systemOpeBusiness.insert_log(log);
}
String strRedirecturl = request.getParameter("redirectUrl");
if(strRedirecturl != null && strRedirecturl.length() > 0) {
response.sendRedirect(strRedirecturl);
}else{
response.sendRedirect("index.jsp");
}
response.getWriter().println("123");
%>
\ No newline at end of file
<script type="text/javascript">
var WebContextPath = '<%=request.getContextPath() %>';
window.location = WebContextPath + "/jfcas";
</script>
\ No newline at end of file
......@@ -287,7 +287,6 @@ form input:focus{
</div>
<script type="text/javascript">
$(document).ready(function () {
//判断ie浏览器ie8以下执行
if(IEVersion()<='8'&&IEVersion()!='-1'){
$.fancybox.open('<div style="line-height:20px;">ie浏览器版本过低,请使用高版本浏览器</div>')
......
<%@ page contentType="text/html; charset=UTF-8" %>
<%
System.out.println("单点退出...........");
session.invalidate();
%>
<html>
<head>
<title>系统正在退出登录,请稍候...</title>
</head>
<body>
<iframe src="http://base.portal.jfbrother.com:9003/jfV4platform/logout" style="display: none"></iframe>
<iframe src="http://bi.jfbrother.com:9003/fastBI/logout" style="display: none"></iframe>
<iframe src="http://pc.jfbrother.com:9003/jfV5pc/logout" style="display: none"></iframe>
<iframe src="http://fwqjk.jfbrother.com:9003/jfV5fwqjk/logout" style="display: none"></iframe>
</body>
<script type="text/javascript">
function getUrl() {
var hostname = location.href;
hostname = hostname.replace("logoutcas.jsp", "jfcas");
return hostname;
}
//登录中心url
var loginCenter = "http://cas.jfbrother.com:9003/cas-test01";
var loginUrl = loginCenter + "/login?service=" + getUrl();
//alert("开始登出:"+loginUrl);
location.href = loginCenter + "/logout?service=" + loginUrl;
</script>
</html>
\ No newline at end of file
......@@ -18,7 +18,7 @@
<a href="#">
<img src="${ctx}/custom/images/index4_lockweb.png" width="12" height="12" />锁屏
</a><span>|</span>
<a href="javascript:window.location='${ctx}/logout'" >
<a href="javascript:window.location='${ctx}/logoutcas.jsp'" >
<img src="${ctx}/custom/images/index4_loginout.png" width="12" height="12" />退出平台
</a>
</div>
......
#------------userDefault-----------------------
login_main_url = system/pages/frameEasyui/main.jsp
#login_main_url = portal?location=homepage/mPortal/portal
login_main_url = jfcas04/index.jsp
userDefaultPass = 0000
#------------uploadpath----------------------------
uploadPath=c:/temp/
......
......@@ -35,11 +35,6 @@
<param name="root">jsonObject</param>
</result>
</action>
<!-- 我的首页的页面 -->
<action name="interim" class="com.jw.app.portlet.action.viewAction"
method="interim">
<result name="interim">/jfcas04/index.jsp</result>
</action>
<!-- 我的第二个首页的页面 -->
<action name="interim2" class="com.jw.app.portlet.action.viewAction"
method="interim2">
......@@ -75,5 +70,12 @@
method="disk">
<result name="disk">/jfcas04/disk.jsp</result>
</action>
</package>
<package name="caslogin" extends="struts-default,json-default">
<action name="jfcas" class="com.gaowj.system.login.CasAction">
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<constant name="struts.action.excludePattern" value="/services.*,/image.*,/images.*,/js.*,/struts.*,/hsdata.*,/photo.*"/>
<package name="gaowj" extends="struts-default,json-default">
<!--注册拦截器-->
<interceptors>
<interceptor name="businessInterceptor" class="com.gaowj.business.util.BusinessInterceptor"/>
<interceptor name="loginInterceptor" class="com.gaowj.business.util.LoginInterceptor"/>
<interceptor-stack name="mystack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="loginInterceptor"/>
<interceptor-ref name="businessInterceptor"/>
</interceptor-stack>
<!-- interceptor-stack name="congfutijiao">
<interceptor-ref name="token"/>
<interceptor-ref name="defaultStack"/>
</interceptor-stack-->
</interceptors>
<!-- 设置默认拦截器栈-->
<default-interceptor-ref name="mystack"/>
<!-- 全局跳转页面-->
<global-results>
<result name="error">/error.jsp</result>
<result name="login">/cas.jsp</result>
</global-results>
<!-- 全局异常-->
<global-exception-mappings>
<exception-mapping result="error" exception="java.lang.Exception"/>
</global-exception-mappings>
<action name="login" class="com.gaowj.system.login.LoginAction">
<result name="success" type="redirect">interim</result>
<result name="input">/system/pages/login/sampleLogin.jsp</result>
</action>
<action name="logout" class="com.gaowj.system.login.LogoutAction">
<result name="input">/system/pages/login/sampleLogin.jsp</result>
</action>
</package>
<package name="gaowj_report" extends="jasperreports-default">
</package>
<package name="error" extends="struts-default">
<default-action-ref name="notFound" />
<action name="notFound">
<result>/system/pages/error/error404.jsp</result>
</action>
<action name="expired">
<result>/system/pages/error/expire.jsp</result>
</action>
</package>
<include file="struts-ext-test.xml"/>
<include file="struts-system.xml"/>
<include file="struts-standard.xml"/>
<include file="struts-ext.xml"/>
<!-- Add packages here -->
</struts>
......@@ -24,6 +24,7 @@ public class interimAction extends BasicAction {
ls_myzd_id = request.getParameter("ls_myzd_id");
ls_operate = request.getParameter("operate");
ls_splx = request.getParameter("splx");
System.out.println("------------------------------tempURL:"+tempURL);
if(tempURL==null || tempURL.trim().length()==0){
// gwjURL = "system/pages/frame/manage.jsp";
// gwjURL = "system/pages/frameDojo/main.jsp";
......
package com.gaowj.system.login;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.jasig.cas.client.authentication.AttributePrincipal;
import com.gaowj.business.SystemOpeBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Java_tool;
public class CasAction extends BasicAction {
/**
*
*/
private static final long serialVersionUID = 4192673206777760091L;
public String execute() throws BusinessException {
response.setHeader("P3P","CP=CAO PSA OUR");
AttributePrincipal principal = (AttributePrincipal)request.getUserPrincipal();
Map<String, Object> attributes = principal.getAttributes();
String userID = attributes.get("userid").toString();
String userName = attributes.get("USER_NAME").toString();
System.out.println("-----1"+userID);
System.out.println("-----2"+userName);
System.out.println("-----3"+attributes.get("UNIT_ID"));
if(userID!=null){
String username = userID;
Java_tool jt = new Java_tool();
SystemOpeBusiness systemOpeBusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
Map<String,Object> query = new HashMap<String,Object>();
query.put("EMID", username);
Map<String,Object> userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
Map<String,Object> sessionUser = new HashMap<String,Object>();
String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString());
sessionUser.put("CODE",userInfoI.get("CODE"));
sessionUser.put("EMID",userInfoI.get("EMID"));
sessionUser.put("EMSEX",userInfoI.get("EMSEX"));
sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("SESSIONID", request.getSession().getId());
sessionUser.put("CURRENTTIME", jt.now_datetime());
sessionUser.put("LOGINIP", request.getRemoteAddr());
sessionUser.put("SERVERIP", request.getLocalAddr());
sessionUser.put("QUANXIAN",u_all_m);
request.getSession().setAttribute("userInfo", sessionUser);
//增加登陆日志
Map<String,Object> log = new HashMap<String,Object>();
log.put("CODE", sessionUser.get("CODE"));log.put("EMNAME", sessionUser.get("EMNAME"));log.put("EMIP", sessionUser.get("LOGINIP"));
log.put("OPENAME", "登陆");log.put("OPETIME", jt.String3date((String)sessionUser.get("CURRENTTIME")));log.put("TYPE", userInfoI.get("TYPE"));
log.put("OPETYPE", "B/S登陆");
systemOpeBusiness.insert_log(log);
}
String strRedirecturl = request.getParameter("redirectUrl");
String toUrl = "";
if(strRedirecturl != null && strRedirecturl.length() > 0) {
toUrl = strRedirecturl;
}else{
toUrl = "index.jsp";
}
try {
response.sendRedirect(toUrl);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
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