/** 用户登录 */ public void login(WebRequest request, WebResponse response) { User user = request.parameterToEntity(User.class); User sessionUser = userService.checkLogin(user); if (CoreUtil.notNull(sessionUser)) { WebUtil.sessionAttr(request, SystemConstant.SESSION_CURRENT_USER, sessionUser); response.write(SystemConstant.MESSAGE_SUCCESS); } else { response.write(SystemConstant.MESSAGE_FAILURE); } }
/** 用户注销 */ public void exit(WebRequest request, WebResponse response) { WebUtil.sessionAttr(request, SystemConstant.SESSION_CURRENT_USER, null); response.write(SystemConstant.MESSAGE_SUCCESS); }