package com.gaowj.system.login;

import java.util.List;
import java.util.Map;

import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.listener.myHttpSessionAttributeListener;


public class LoginAction  extends BasicAction {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -6074460857486096013L;

	@SuppressWarnings("unchecked")
	public String execute() throws BusinessException {
		Map<String,Object> u = (Map<String, Object>) request.getSession().getAttribute("userInfo");

		if(u == null){
			
		   return INPUT;
		}else{
			
			if(request.getSession().getAttribute("sessionUser")!=null){
				List<Map<String,Object>> sessionUser = (List<Map<String, Object>>) request.getSession().getAttribute("sessionUser");
				myHttpSessionAttributeListener.setSessionUser(sessionUser);
			}
			
			if(request.getSession().getAttribute("beforeUser")!=null){
				request.getSession().removeAttribute("beforeUser");
			}
			
			super.setChkLicenseNum(0);
			
//			List<Map<String,Object>> user = myHttpSessionAttributeListener.getSessionUser(request);
			
//			System.out.println("在线用户");
//			System.out.println(user);
			return SUCCESS;
		}
	}
}
