@@ -0,0 +1,1808 @@
+package com.lance.freemaker.web.system;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpSession;%0A%0Aimport org.apache.commons.lang3.StringUtils;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.servlet.mvc.support.RedirectAttributes;%0A%0Aimport com.lance.freemaker.domain.UserInfo;%0Aimport com.lance.freemaker.service.UserService;%0Aimport com.lance.freemaker.utils.EncryptUtils;%0A%0A@Controller%0Apublic class SystemLoginController %7B%0A%09@Autowired%0A%09private UserService userService;%0A%09%0A%09/**%0A%09 * Login GetMethod%0A%09 * @return%0A%09 */%0A%09@RequestMapping(value=%22system/login%22, method=RequestMethod.GET)%0A%09public String login() %7B%0A%09%09return %22system/login.jsp%22;%0A%09%7D%0A%09%0A%09/**%0A%09 * Login PostMethod%0A%09 * @return%0A%09 */%0A%09@RequestMapping(value=%22system/login%22, method=RequestMethod.POST)%0A%09public String login(HttpServletRequest request, RedirectAttributes rediect) %7B%0A%09%09String account = request.getParameter(%22account%22);%0A%09%09String password = request.getParameter(%22password%22);%0A%09%09%0A%09%09UserInfo info = userService.findByAccount(account);%0A%09%09if(info == null) %7B%0A%09%09%09rediect.addFlashAttribute(%22errorText%22, %22%E8%AF%A5%E7%94%A8%E6%88%B7%E4%B8%8D%E5%AD%98%E5%9C%A8%22);%0A%09%09%09return %22redirect:/system/login%22;%0A%09%09%7D%0A%09%09%0A%09%09if(!StringUtils.equals(EncryptUtils.encryptMD5(password), info.getPassword())) %7B%0A%09%09%09rediect.addFlashAttribute(%22errorText%22, %22%E5%AF%86%E7%A0%81%E9%94%99%E8%AF%AF%22);%0A%09%09%09return %22redirect:/system/login%22;%0A%09%09%7D%0A%09%09%0A%09%09request.getSession().setAttribute(%22sys_user_key%22, info);%0A%09%09return %22redirect:/system/admin/index%22;%0A%09%7D%0A%09%0A%09/**%0A%09 * Exit%0A%09 * @return%0A%09 */%0A%09@RequestMapping(%22system/logout%22)%0A%09public String logout(HttpSession session) %7B%0A%09%09session.invalidate();%0A%09%09return %22redirect:/system/login%22;%0A%09%7D%0A%7D

add resource