|
|
|
@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.InitBinder;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
import org.springframework.web.servlet.view.RedirectView;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
@ -51,11 +53,12 @@ public class IndexController {
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/toLogin")
|
|
|
|
|
@PermissionLimit(limit=false)
|
|
|
|
|
public String toLogin(HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
|
public ModelAndView toLogin(HttpServletRequest request, HttpServletResponse response,ModelAndView modelAndView) {
|
|
|
|
|
if (loginService.ifLogin(request, response) != null) {
|
|
|
|
|
return "redirect:/";
|
|
|
|
|
modelAndView.setView(new RedirectView("/",true,false));
|
|
|
|
|
return modelAndView;
|
|
|
|
|
}
|
|
|
|
|
return "login";
|
|
|
|
|
return new ModelAndView("login");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="login", method=RequestMethod.POST)
|
|
|
|
|