1 public String doLoginAction() throws Exception {
2 HttpServletResponse response = ServletActionContext.getResponse();
3 response.setHeader("Pragma", "No-cache");
4 response.setHeader("Cache-Control", "no-cache");
5 response.setDateHeader("Expires", 0);
6 try {
7 User loginUser =
8 UMUtils.getUserMgrLocal().login(user.getName(), user.getPassword().toCharArray());
9 /** 这里还要判断用户是否有效 */
10 if (loginUser == null) {
11 throw new Exception("用户名密码不正确,或者不在登陆有效期内,或已经被锁");
12 }
13 ActionContext.getContext().getSession().put(OrgConstants.SESSION_USER, loginUser);
14 } catch (Exception e) {
15 throw new Exception("用户名密码不正确,或者不在登陆有效期内,或已经被锁");
16
17 }
18 return SUCCESS;
19 }
20