|
@@ -1,23 +1,18 @@
|
|
package cn.com.qmth.stmms.common.controller;
|
|
package cn.com.qmth.stmms.common.controller;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
-import java.util.Locale;
|
|
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
-import org.springframework.context.i18n.LocaleContextHolder;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
-import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
|
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
@@ -81,27 +76,27 @@ public class LoginController {
|
|
|
|
|
|
new WebUser(u.getId(), u.getRole(), webToken).writeToSession(session);
|
|
new WebUser(u.getId(), u.getRole(), webToken).writeToSession(session);
|
|
|
|
|
|
- if (u.getRole() == Role.SYS_ADMIN || u.getRole() == Role.SCHOOL_ADMIN || u.getRole() == Role.SUBJECT_HEADER
|
|
|
|
- || u.getRole() == Role.SCHOOL_VIEWER) {
|
|
|
|
|
|
+ if (u.getRole() == Role.SYS_ADMIN || u.getRole() == Role.SCHOOL_ADMIN
|
|
|
|
+ || u.getRole() == Role.SUBJECT_HEADER || u.getRole() == Role.SCHOOL_VIEWER) {
|
|
ModelAndView modelAndView = new ModelAndView("redirect:admin/home");
|
|
ModelAndView modelAndView = new ModelAndView("redirect:admin/home");
|
|
return modelAndView;
|
|
return modelAndView;
|
|
} else {
|
|
} else {
|
|
ModelAndView view = new ModelAndView("modules/sys/login");
|
|
ModelAndView view = new ModelAndView("modules/sys/login");
|
|
- view.addObject("message", "用户没有访问权限");
|
|
|
|
|
|
+ view.addObject("message", "user.login.error.access");
|
|
view.addObject("showType", showType);
|
|
view.addObject("showType", showType);
|
|
view.addObject("indexLogo", indexLogo);
|
|
view.addObject("indexLogo", indexLogo);
|
|
return view;
|
|
return view;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
- modelAndView.addObject("message", "密码错误");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.password");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
- modelAndView.addObject("message", "无此用户");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.account");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
@@ -111,26 +106,27 @@ public class LoginController {
|
|
if (marker != null) {
|
|
if (marker != null) {
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
ModelAndView modelAndView = new ModelAndView("modules/sys/login");
|
|
if (!marker.getPassword().equals(user.getPassword())) {
|
|
if (!marker.getPassword().equals(user.getPassword())) {
|
|
- modelAndView.addObject("message", "密码错误");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.password");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
if (marker.isEnable() == false) {
|
|
if (marker.isEnable() == false) {
|
|
- modelAndView.addObject("message", "帐号已禁用");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.disabled");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
- MarkGroup group = groupService.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
|
|
|
|
|
|
+ MarkGroup group = groupService.findOne(marker.getExamId(), marker.getSubjectCode(),
|
|
|
|
+ marker.getGroupNumber());
|
|
if (group == null) {
|
|
if (group == null) {
|
|
- modelAndView.addObject("message", "大题不存在");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.group");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
}
|
|
}
|
|
if (group.getStatus() == MarkStatus.FINISH) {
|
|
if (group.getStatus() == MarkStatus.FINISH) {
|
|
- modelAndView.addObject("message", "评卷已结束");
|
|
|
|
|
|
+ modelAndView.addObject("message", "user.login.error.finish");
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("showType", showType);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
modelAndView.addObject("indexLogo", indexLogo);
|
|
return modelAndView;
|
|
return modelAndView;
|
|
@@ -150,7 +146,7 @@ public class LoginController {
|
|
}
|
|
}
|
|
|
|
|
|
ModelAndView view = new ModelAndView("modules/sys/login");
|
|
ModelAndView view = new ModelAndView("modules/sys/login");
|
|
- view.addObject("message", "帐号不存在");
|
|
|
|
|
|
+ view.addObject("message", "user.login.error.account");
|
|
view.addObject("showType", showType);
|
|
view.addObject("showType", showType);
|
|
view.addObject("indexLogo", indexLogo);
|
|
view.addObject("indexLogo", indexLogo);
|
|
return view;
|
|
return view;
|