|
@@ -5,6 +5,7 @@ import java.util.Date;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import javax.servlet.http.HttpSession;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -152,7 +153,8 @@ public class LoginController extends BaseController{
|
|
return markerLogin(request, marker, user.getPassword());
|
|
return markerLogin(request, marker, user.getPassword());
|
|
}
|
|
}
|
|
if(loginType!=null){
|
|
if(loginType!=null){
|
|
- session.setParameter("message", "帐号不存在");
|
|
|
|
|
|
+ HttpSession httpSession = request.getSession();
|
|
|
|
+ httpSession.setAttribute("message", "帐号不存在");
|
|
ModelAndView view = new ModelAndView("redirect:/mark-login");
|
|
ModelAndView view = new ModelAndView("redirect:/mark-login");
|
|
return view;
|
|
return view;
|
|
}
|
|
}
|
|
@@ -243,15 +245,17 @@ public class LoginController extends BaseController{
|
|
public ModelAndView loginInit(HttpServletRequest request) {
|
|
public ModelAndView loginInit(HttpServletRequest request) {
|
|
StmmsSession session = RequestUtils.getSession(request);
|
|
StmmsSession session = RequestUtils.getSession(request);
|
|
session.setParameter(LOGIN_TYPE_KEY, "mark-login");
|
|
session.setParameter(LOGIN_TYPE_KEY, "mark-login");
|
|
- String message = session.getParameter("message");
|
|
|
|
- session.setParameter("message", null);
|
|
|
|
|
|
+ HttpSession httpSession = request.getSession();
|
|
|
|
+ String message = (String) httpSession.getAttribute("message");
|
|
if ("aopeng".equals(appIndex)) {
|
|
if ("aopeng".equals(appIndex)) {
|
|
ModelAndView aPview = new ModelAndView(AP_MARK_LOGIN_VIEW);
|
|
ModelAndView aPview = new ModelAndView(AP_MARK_LOGIN_VIEW);
|
|
aPview.addObject("message", StringUtils.trimToNull(message));
|
|
aPview.addObject("message", StringUtils.trimToNull(message));
|
|
|
|
+ httpSession.removeAttribute("message");
|
|
return aPview;
|
|
return aPview;
|
|
}
|
|
}
|
|
ModelAndView modelAndView = new ModelAndView(LOGIN_VIEW);
|
|
ModelAndView modelAndView = new ModelAndView(LOGIN_VIEW);
|
|
modelAndView.addObject("message", StringUtils.trimToNull(message));
|
|
modelAndView.addObject("message", StringUtils.trimToNull(message));
|
|
|
|
+ httpSession.removeAttribute("message");
|
|
modelAndView.addObject(LOGIN_TYPE_KEY, "mark-login");
|
|
modelAndView.addObject(LOGIN_TYPE_KEY, "mark-login");
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
@@ -267,6 +271,7 @@ public class LoginController extends BaseController{
|
|
*/
|
|
*/
|
|
public ModelAndView markerLogin(HttpServletRequest request, Marker marker, String password) {
|
|
public ModelAndView markerLogin(HttpServletRequest request, Marker marker, String password) {
|
|
StmmsSession session = RequestUtils.getSession(request);
|
|
StmmsSession session = RequestUtils.getSession(request);
|
|
|
|
+ HttpSession httpSession = request.getSession();
|
|
String loginType = session.getParameter(LOGIN_TYPE_KEY);
|
|
String loginType = session.getParameter(LOGIN_TYPE_KEY);
|
|
ModelAndView modelAndView = new ModelAndView(LOGIN_VIEW);
|
|
ModelAndView modelAndView = new ModelAndView(LOGIN_VIEW);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
@@ -275,12 +280,12 @@ public class LoginController extends BaseController{
|
|
modelAndView = new ModelAndView("redirect:/mark-login");
|
|
modelAndView = new ModelAndView("redirect:/mark-login");
|
|
}
|
|
}
|
|
if (!marker.getPassword().equals(password)) {
|
|
if (!marker.getPassword().equals(password)) {
|
|
- session.setParameter("message", "密码错误");
|
|
|
|
|
|
+ httpSession.setAttribute("message", "密码错误");
|
|
modelAndView.addObject("message", "密码错误");
|
|
modelAndView.addObject("message", "密码错误");
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
if (marker.isEnable() == false) {
|
|
if (marker.isEnable() == false) {
|
|
- session.setParameter("message", "帐号已禁用");
|
|
|
|
|
|
+ httpSession.setAttribute("message", "帐号已禁用");
|
|
modelAndView.addObject("message", "帐号已禁用");
|
|
modelAndView.addObject("message", "帐号已禁用");
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
@@ -291,7 +296,7 @@ public class LoginController extends BaseController{
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
String start = exam.getStartTime() == null ? "" : " 开始时间:" + sdf.format(exam.getStartTime());
|
|
String start = exam.getStartTime() == null ? "" : " 开始时间:" + sdf.format(exam.getStartTime());
|
|
String end = exam.getEndTime() == null ? "" : " 结束时间:" + sdf.format(exam.getEndTime());
|
|
String end = exam.getEndTime() == null ? "" : " 结束时间:" + sdf.format(exam.getEndTime());
|
|
- session.setParameter("message", "不在评卷时间范围 " + start + " " + end);
|
|
|
|
|
|
+ httpSession.setAttribute("message", "不在评卷时间范围 " + start + " " + end);
|
|
modelAndView.addObject("message", "不在评卷时间范围 " + start + " " + end);
|
|
modelAndView.addObject("message", "不在评卷时间范围 " + start + " " + end);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|