model.addObject("errMsg", "用户被锁定");
return model;
}
if (authuser != null) {
RunTimeUser rtUser = new RunTimeUser(authuser);
rtUser.setUserIp(request.getRemoteAddr());
rtUser.setSessionID(request.getSession().getId());
String sid = request.getSession().getId();
request.getSession().removeAttribute(sid);
//request.getSession().setAttribute(sid, rtUser);
if (!ArrayUtil.isEmptyCollection(rtUser.getRoles())) {
rtUser.setIsmanager(true);
}
if(rtUser.getUsertype()==2){
long _mid = rtUser.getOrganizationid();
rtUser.setMerchant(true);
}
if(rtUser.getUsertype()==3){
long _mid = rtUser.getOrganizationid();
rtUser.setOrganization(true);
}
// 设置当前登录时间ip 下次登录时拿上次的登录时间ip
authuser.setLastlogin(new Date());
authuser.setIp(request.getRemoteAddr());
userCardService.updateUser(authuser);
String url = "/page/management/member/member_welcome.jsp";
if (rtUser.isIsmanager()) {
url = "/page/management/common/main.jsp";
rtUser.setUrl(url);
request.getSession().setAttribute(sid, rtUser);
return new ModelAndView("management/common/main");
}
//子帐号未授权提示无此帐号
if (rtUser.getUsertype() != User.USER_TYPE_NORMAL) {
ModelAndView model = new ModelAndView("gateway/login");
model.addObject("username", username);
model.addObject("errMsg", "用户名、密码错误");
return model;
}
/*if(rtUser.isMerchant()){
url = "/page/management/merchant/merchant_main.jsp";
rtUser.setUrl(url);
request.getSession().setAttribute(sid, rtUser);
return new ModelAndView("management/merchant/merchant_main");
}
if(rtUser.isOrganization()){
url = "/page/management/organization/origanization_main.jsp";
rtUser.setUrl(url);
request.getSession().setAttribute(sid, rtUser);
return new ModelAndView("management/organization/origanization_main");
}*/
rtUser.setUrl(url);
request.getSession().setAttribute(sid, rtUser);
return new ModelAndView("management/member/member_welcome");
}
ModelAndView model = new ModelAndView("gateway/login");
model.addObject("username", username);