Commit 9fe36619 by 周添尉

casAction

parent bafcb65c
package com.gaowj.system.login; package com.gaowj.system.login;
import java.io.IOException; import java.io.IOException;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.jasig.cas.client.authentication.AttributePrincipal; import org.jasig.cas.client.authentication.AttributePrincipal;
...@@ -36,29 +38,36 @@ public class CasAction extends BasicAction { ...@@ -36,29 +38,36 @@ public class CasAction extends BasicAction {
Map<String,Object> query = new HashMap<String,Object>(); Map<String,Object> query = new HashMap<String,Object>();
query.put("EMID", username); query.put("EMID", username);
Map<String,Object> userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0); Map<String,Object> userInfoI = null;
Map<String,Object> sessionUser = new HashMap<String,Object>(); List<Map<String,Object>> listUser = systemOpeBusiness.listLoginUserInfo(query);
String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString()); if(listUser.size()>0){
sessionUser.put("CODE",userInfoI.get("CODE")); userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
sessionUser.put("EMID",userInfoI.get("EMID")); Map<String,Object> sessionUser = new HashMap<String,Object>();
sessionUser.put("EMSEX",userInfoI.get("EMSEX")); String u_all_m = systemOpeBusiness.getUserAllModule(userInfoI.get("CODE").toString());
sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME")); sessionUser.put("CODE",userInfoI.get("CODE"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART")); sessionUser.put("EMID",userInfoI.get("EMID"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME")); sessionUser.put("EMSEX",userInfoI.get("EMSEX"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME")); sessionUser.put("EMDEPARTNAME",userInfoI.get("EMDEPARTNAME"));
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("SESSIONID", request.getSession().getId()); sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("CURRENTTIME", jt.now_datetime()); sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("LOGINIP", request.getRemoteAddr()); sessionUser.put("BEFORETIME", jt.date3string((Date)userInfoI.get("BEFORETIME")));
sessionUser.put("SERVERIP", request.getLocalAddr());
sessionUser.put("QUANXIAN",u_all_m); sessionUser.put("SESSIONID", request.getSession().getId());
request.getSession().setAttribute("userInfo", sessionUser); sessionUser.put("CURRENTTIME", jt.now_datetime());
//增加登陆日志 sessionUser.put("LOGINIP", request.getRemoteAddr());
Map<String,Object> log = new HashMap<String,Object>(); sessionUser.put("SERVERIP", request.getLocalAddr());
log.put("CODE", sessionUser.get("CODE"));log.put("EMNAME", sessionUser.get("EMNAME"));log.put("EMIP", sessionUser.get("LOGINIP")); sessionUser.put("QUANXIAN",u_all_m);
log.put("OPENAME", "登陆");log.put("OPETIME", jt.String3date((String)sessionUser.get("CURRENTTIME")));log.put("TYPE", userInfoI.get("TYPE")); sessionUser.put("SESSIONUSER", request.getSession());
log.put("OPETYPE", "B/S登陆"); request.getSession().setAttribute("userInfo", sessionUser);
systemOpeBusiness.insert_log(log); //增加登陆日志
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 strRedirecturl = request.getParameter("redirectUrl");
String toUrl = ""; String toUrl = "";
......
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