Commit 9fe36619 by 周添尉

casAction

parent bafcb65c
package com.gaowj.system.login;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jasig.cas.client.authentication.AttributePrincipal;
......@@ -36,7 +38,10 @@ public class CasAction extends BasicAction {
Map<String,Object> query = new HashMap<String,Object>();
query.put("EMID", username);
Map<String,Object> userInfoI = systemOpeBusiness.listLoginUserInfo(query).get(0);
Map<String,Object> userInfoI = null;
List<Map<String,Object>> listUser = systemOpeBusiness.listLoginUserInfo(query);
if(listUser.size()>0){
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"));
......@@ -46,12 +51,14 @@ public class CasAction extends BasicAction {
sessionUser.put("EMDEPART",userInfoI.get("EMDEPART"));
sessionUser.put("EMNAME",userInfoI.get("EMNAME"));
sessionUser.put("BEFORETIME",userInfoI.get("BEFORETIME"));
sessionUser.put("BEFORETIME", jt.date3string((Date)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);
sessionUser.put("SESSIONUSER", request.getSession());
request.getSession().setAttribute("userInfo", sessionUser);
//增加登陆日志
Map<String,Object> log = new HashMap<String,Object>();
......@@ -60,6 +67,8 @@ public class CasAction extends BasicAction {
log.put("OPETYPE", "B/S登陆");
systemOpeBusiness.insert_log(log);
}
}
String strRedirecturl = request.getParameter("redirectUrl");
String toUrl = "";
if(strRedirecturl != null && strRedirecturl.length() > 0) {
......
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