예제 #1
0
 @RequestMapping
 public ModelAndView mymenu(
     String parentCode, Map<String, Object> out, HttpServletRequest request) {
   if (parentCode == null) {
     parentCode = "";
   }
   SessionUser sessionUser = getCachedUser(request);
   List<AuthMenu> list =
       AuthUtils.getInstance()
           .queryMenuByParent(parentCode, AuthConst.PROJECT_CODE, sessionUser.getAccount());
   return printJson(list, out);
 }
예제 #2
0
 @RequestMapping
 public ModelAndView checkuser(
     Map<String, Object> out,
     HttpServletRequest request,
     HttpServletResponse response,
     String account,
     String password) {
   SessionUser sessionUser =
       AuthUtils.getInstance()
           .validateUser(
               response, account, password, AuthConst.PROJECT_CODE, AuthConst.PROJECT_PASSWORD);
   ExtResult result = new ExtResult();
   if (sessionUser != null) {
     setSessionUser(request, sessionUser);
     result.setSuccess(true);
   } else {
     result.setData("用户名或者密码写错了,检查下大小写是否都正确了,再试一次吧 :)");
   }
   return printJson(result, out);
 }
예제 #3
0
 @RequestMapping
 public ModelAndView logout(
     Map<String, Object> out, HttpServletRequest request, HttpServletResponse response) {
   AuthUtils.getInstance().logout(request, response, null);
   return new ModelAndView("redirect:login.htm");
 }
예제 #4
0
 public SessionUser getCachedUser(HttpServletRequest request) {
   return AuthUtils.getInstance().getSessionUser(request, null);
 }
예제 #5
0
 public void cleanCachedSession(HttpServletRequest request) {
   AuthUtils.getInstance().clearnSessionUser(request, null);
 }
예제 #6
0
 public void setSessionUser(HttpServletRequest request, SessionUser sessionUser) {
   AuthUtils.getInstance().setSessionUser(request, sessionUser, null);
 }